phpDocumentor is a tool which creates complete documentation like Javadocs for PHP code.
Installing phpDocumentor
Install libraries.
sudo apt-get libapache2-mod-php5
Restart Apache.
sudo service apache2 restart
Install PEAR. PEAR is a repository of php extensions:
sudo pear config-set data_dir /var/www
Tell PEAR where to install phpDocumentor:
<br>$ sudo pear install --alldeps phpDocumentor<br>
www-data is user Apache on Ubuntu:
sudo mkdir /var/www/phpDocumentorOuput
sudo chown www-data /var/www/phpDocumentorOutput
Using phpDocumentor
You can use phpDocumentor on commandline or via a web interface. For the web interface, type the following http://localhost/phpDocumentor in your browser. Click on Files tab and provide address of the file or directory your intend to create documentation for. Then click on output and specify the output directory. Then hit create button.
On commandline:
Create an output directory and assign proper permissions:
sudo mkdir /var/www/docs
sudo chown my-user_account /var/www/docs
sudo 644 /var/www/docs
Create documentation for one file:
phpdoc -d /var/www/my_code_directory/my_code.php -t /var/www/docs
Create documentation all files in a directory and its subdirectories:
phpdoc -d /var/www/my_code_directory -t /var/www/docs
Change the look of the documented code:
phpdoc -o HTML:frames:earthli -d /var/www/my_code_directory -t /var/www/docs