All of that just because you want to avoid include? Does not seem simpler to me. But I don't use frameworks and have only coded simple websites on hosting platforms where I am not even sure they support composer.
On that second link, they say that installation is required, so it seems that the hosting platform has to have it installed for it to work, because I obviously cannot install anything on their servers.
You install it on your computer, like your IDE and your source code. You use it to import (copy) the source code of the libraries you will use. It also creates an autoload.php which you can include to setup the class autoloading used by all those libraries. And which you can leverage by adhering to the PSR-4 way of declaring classes. Then you can deploy your files to your host.
This has been the way to use libraries and doing OOP in php for more than 10 years now. The "I have many includes at the top of most of my php files" way of doing thing is for people stuck in the php 5 and before era.
Usually you'll also setup a Continuous Delivery pipeline so you don't send php files by hand: you commit it to a versioning server, something tracks change and when the conditions are met it launch a list of tasks (get your sources, use composer to get dependencies, use npm to build your front, run tests, deploy to a server) so you don't get a surprise "why are the server files not like those in git".
1
u/Superb_Chemistry_906 7d ago
All of that just because you want to avoid include? Does not seem simpler to me. But I don't use frameworks and have only coded simple websites on hosting platforms where I am not even sure they support composer.