October 21st, 2016 - BADCamp, 2016
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer
composer init
composer install
composer require symfony/yaml
require 'vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;
$value = Yaml::parse(file_get_contents('file.yml'));
composer global require drush/drush
composer global exec drush
export PATH=$PATH:~/.composer/vendor/bin
drush
composer global require composer/composer
Cleans up some of the require paths for global dependencies
By Good ol' Greg Anderson
composer global require sllh/composer-versions-check
composer update
1 package is not up to date: - symfony/yaml (3.0.1) latest is 3.1.5
{
"name": "mycomposer",
"scripts": {
"test": "behat",
"awesometime": "echo 'Hello World'"
}
}
composer test
--- Runs Behat!
composer awesometime
--- Hello World