Using the repository in the project
In order to use the installed dependencies in the project, fill in the path in the PHP section:
require_once('vendor/autoload.php');
An example of a PHP file adding lines to the log:
<?phprequire_once('vendor/autoload.php');use Monolog\Level;use Monolog\Logger;use Monolog\Handler\StreamHandler;$logger = new Logger('channel-name');$logger->pushHandler(new StreamHandler('app.log', Logger::DEBUG));$logger->info('This is log');$logger->warning('This is log warning');$logger->error('This is log error');?>
The repository used by default is repo.packagist.org.
In order to edit the configuration file:
- In the Main menu, select WWW-domains.
- Select the desired website and click on the context menu button “…”.
- In the drop-down menu, select PHP Composer installed packages.
- In the form that opens, click Configuration file.
- Make the necessary changes and click Ok.
When saving, the correctness of the JSON format is checked and the execution of the install or update command with the dry-run key is emulated.
For example, the preliminary check of the dependencies' installation:
/bin/sh -c cd\ /var/www/cm/data/www/example.com\;./composer.phar\ install\ --dry-run