Connecting Composer libraries to Php site
Having figured out what Compser is and what it is for, you should figure out how to use it on the site. In the article, we will consider connecting libraries pulled up through Composer.
Propel makes it easy to access the database, so it allows you to quickly expand the project and convenient to use. A short description on using composer is here .
Take the package from
1. At the root of the project, create composer.json :
{
"require": {
"propel/propel": "dev-master"
}
}
2. At the root of the project, where composer.json - install :
sudo composer install
In my case /var/www/test1.loc
3. These packages will be pulled up :
Don't pay attention to "PHP Warning", it's echoes of my previous project)
4. Connection on site :
Don't forget to include autoload.php. For example, I placed in index.php
<?php
include_once './vendor/autoload.php';
Having figured out what Compser is and what it is for, you should figure out how to use it on the site. In the article, we will consider connecting libraries pulled up through Composer.
Composer brought the convenience of using ready-made solutions, packages and libraries. Proper organization of work with Composer can make it easy to maintain always up-to-date versions of the libraries used in the project. Consider getting started with Composer.