O
O
ObehanProger2020-05-12 11:21:47
Composer
ObehanProger, 2020-05-12 11:21:47

Why does Laravel run through Composer?

Many advanced CMS written in php, such as Wordpress, work and install without any composer. Why then use composer in Laravel and Yii2? What is its advantage, besides the convenient installation of packages and the creation of framework elements (models, controllers, etc. - such as "convenient framework manager"), and why couldn't it be used to create such MVC frameworks by simple class autoloading via spl_autoload_register? How is the logic of working through Composer arranged in the depths of the framework core here? Was Composer written specifically for these frameworks?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zorca, 2020-05-12
@ObehanProger

This is primarily necessary for code control. In any CMS without Composer, minimal changes to the code of any part will lead to the collapse of the entire system and no one will know what exactly has changed.

A
Alexander Aksentiev, 2020-05-12
@Sanasol

why it was impossible to use simple class autoloading via spl_autoload_register when creating such MVC frameworks

Composer is just a simple autoload, it doesn't do anything else. There are no "elements" in it, and there is no work "inside the core of the framework" with the composer.
Many advanced CMS written in php, such as Wordpress, work and install without any composer.

They were written at a time when there was no smell of composer yet in the main.
And now they can't take it and just start using it, because there weren't many development standards at the time they started making them. And now it's a mountain of shit code, in fact, which is not compatible with autoload. Wordpress generally works a little more than completely on global functions and variables.

S
Sanes, 2020-05-12
@Sanes

Wants and works. Someone from the PHP world came up with standards and repositories.
The composer does not create any elements. This is a library repository.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question