Composer
Install composer
Requirements: php and git should be installed first.
http://getcomposer.org/doc/00-intro.md
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
For Windows there is installer: https://getcomposer.org/Composer-Setup.exe
Search for package
composer search phpunit
Create composer.json file
composer init
Example of composer.json file
{
"name": "mac2000/example",
"description": "example",
"license": "MIT",
"authors": [
{
"name": "Marchenko Alexandr",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": { "Acme\\": "src" }
},
"autoload-dev": {
"psr-4": { "Acme\\Tests\\": "tests" }
},
"require": {
"swiftmailer/swiftmailer": "*"
},
"require-dev": {
"phpunit/phpunit": "*"
}
}
composer.sublime-snippet
<snippet>
<content><![CDATA[{
"name": "mac2000/${1:example}",
"description": "${2:example}",
"license": "MIT",
"authors": [
{
"name": "Marchenko Alexandr",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {"${1:Acme}\\": "src"}
},
"autoload-dev": {
"psr-4": {"${1:Acme}\\Tests\\": "tests"}
},
"require": {
${3:"swiftmailer/swiftmailer": "*"}
},
"require-dev": {
${4:"phpunit/phpunit": "*"}
}
}]]></content>
<tabTrigger>composer</tabTrigger>
<scope>source.json, text.plain</scope>
</snippet>
Some usefull packages
composer global require "sebastian/phpcpd=x"
composer global require "phpunit/phpunit=3.7.x"
composer global require "phpmd/phpmd=x"
composer global require "pdepend/pdepend=x"
composer global require "squizlabs/php_codesniffer=x"
PHPUnit 3.7.x used for PHPStorm 7.1 wich does not support newer version at moment.
Add %USERPROFILE%\AppData\Roaming\Composer\vendor\bin
to system path.
phpmd ./ text cleancode, codesize, controversial, design, naming, unusedcode --exclude vendor
phpcs --ignore=vendor --standard=psr2 ./
phpcpd --exclude=vendor ./
pdepend --jdepend-chart=jdepend.svg --overview-pyramid=pyramid.svg --ignore=vendor ./
phpunit --coverage-html ./report
Global composer.json path is: %USERPROFILE%\AppData\Roaming\Composer\composer.json
compaser.phar path is: C:\ProgramData\ComposerSetup\bin\composer.phar