Posts published in October 2014

Easy way to install PHP QA tools

If you need an easy and quick way to install your PHP QA tools, you can use the next bash snippet.

# Install composer based tools
cat > ~/.composer/composer.json <<EOF
    "require": {
        "halleck45/phpmetrics": "@dev",
        "squizlabs/php_codesniffer": "*",
        "phpunit/phpunit": "*",
        "sebastian/phpcpd": "*",
        "sebastian/phpdcd": "*",
        "phpmd/phpmd" : "@stable",
        "pdepend/pdepend" : "@stable",
        "phploc/phploc": "*",
        "sebastian/hhvm-wrapper": "*",
        "theseer/phpdox": "*"
curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer
/usr/local/bin/composer global install
chown -R $SUDO_USER.$SUDO_USER ~/.composer

And all your required tools (phpunit, phploc, phpmd, pdepend, …) are now located at ~/.composer/vendor/bin, so set your $PATH environment variable to include it.

If you find it useful please share it.