Composer example of use. Libraries and autoloads open

Composer example of use. Libraries and autoloads

Composer itself downloads and installs the necessary libraries, and then places them in the project.

Download or get commands for Composerhttps://getcomposer.org/download/

We recommend using PSR 4-Autoloader to automatically autoload class files. For this in the composer.json file we will add the following settings:

{
"autoload":{
"psr-4": {
"App\\": "app/"
}
}
}

Then through the console called in the folder with files composer.phar call the following commands:

$ php composer.phar ^C
$ composer dump-autoload -o

Then you need to attach (require once) the autoload.php file to our index.php file

0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation