How to make phpdocumentor recognise non-php file extensions

Category: Note to Self, PHP

(Update 17 Dec 2012: This post relates to PhpDocumentor version 1. Version 2 is now out and allows configuration on a per-project basis, see comments below)

I use  phpdocumentor to generate documentation for my custom PHP projects, but by default it will only process files with the standard file extensions (.php, .phtml .inc etc). However Drupal makes use of  non-standard extensions .install and .module. Phpdocumentor needs to be told this.

To do that, edit  phpDocumentor.ini. On my Fedora system it is located:

 /usr/share/pear/data/PhpDocumentor.ini

Find  the group [_phpDocumentor_phpfile_exts] and add required suffixes so it looks something like this:

[_phpDocumentor_phpfile_exts]
php
php3
php4
phtml
inc
module
install

MySql Snippets

Perform global search and replace of partial text

 UPDATE `tablename` SET `column` = REPLACE( COLUMN, 'searchstring', 'replacestring' );

Set timestamp to current and update on db update

ALTER TABLE `tablename` [MODIFY|ADD] `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
 

Query for next and previous records in table

e.g return the id of the next record, sorted by title

SELECT id, title FROM my_table WHERE title > (SELECT title FROM my_table WHERE id = my_id) ORDER BY title ASC LIMIT 1

and previous record:

SELECT id , title FROM my_table WHERE title < (SELECT my_table FROM my_table WHERE id  = my_id)  ORDER BY title DESC LIMIT 1