Downloads
Installing via Composer
Create a composer.json file in your project directory and add PHPMD as a required dependency:
{
"require": {
"phpmd/phpmd" : "1.4.*"
}
}Then install Composer in your project (or download the composer.phar directly):
~ $ curl -s http://getcomposer.org/installer | phpAnd finally let Composer install the project dependencies:
~ $ php composer.phar installFrom the github repository
If you like to participate on the social coding plattform GitHub, you can use PHPMD's mirror to fork and contribute to PHPMD.
~ $ git clone git://github.com/phpmd/phpmd.gitThen cd into the checkout directory initialize the referenced sub modules:
~ $ cd phpmd
~/phpmd $ git submodule update --initThis installs the build framework used by PHPMD. To initialize PHPMD's requirements you should now invoke Ant with the initialize target:
~/phpmd $ ant initializeThis command installs the dependencies used by PHPMD. Please not that this command will produce a lot of output on the shell.
Installing as a PEAR package
The preferred way to install PHPMD should be the PEAR installer and PHPMD's PEAR channel, where you will always find the latest stable version. Because PHPMD heavily relies on metrics measured with PHP Depend you must also discover this project's PEAR Channel. Just enter:
~ $ pear channel-discover pear.phpmd.org
~ $ pear channel-discover pear.pdepend.org
~ $ pear install --alldeps phpmd/PHP_PMDRequirements
PHPMD itself is considered as an early development version at its current state. It relies on the following software products: