code of NexushPHP from http://sourceforge.net/projects/nexusphp/