classes/BuildTasks.php
static function run_generate_documentation( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        if ( !SharedLock::acquire( $opts['extension']['name'], LOCK_EX, $opts ) )
            throw new PakeException( "Source code locked by another process" );

        $destdir = self::getBuildDir( $opts ) . '/' . $opts['extension']['name'];
        $docdir = $destdir . '/doc';
        $files = pakeFinder::type( 'file' )->name( '*.rst' )->in( $docdir );
        foreach ( $files as $i => $file )
        {
            $dst = substr( $file, 0, -3 ) . 'html';
            $document = new ezcDocumentRst();
            $document->loadFile( $file );
            $docbook = $document->getAsXhtml();
            file_put_contents( $dst, $docbook->save() );
            pake_echo_action( 'file+', $dst );
            pake_remove( $file, '' );
        }

        /*
        * A few extension have Makefiles to generate documentation
        * We remove them as well as the original .rst files
        * NB: this is not done anymore since version 0.1. Use files.to_exclude option instead
        */
        //pake_remove( pakeFinder::type( 'file' )->name( 'Makefile' )->in( $destdir ), '' );

        // doxygen
        if ( $opts['create']['doxygen_doc'] )
        {
            pake_mkdirs( $docdir . '/api' );
            $doxygen = self::getTool( 'doxygen', $opts );
            $doxyfile = $destdir . '/doxyfile';
            pake_copy( self::getResourceDir() . '/doxyfile_master', $doxyfile, array( 'override' => true ) );
            file_put_contents( $doxyfile,
                "\nPROJECT_NAME = " . $opts['extension']['name'] .
                "\nPROJECT_NUMBER = " . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] .
                "\nOUTPUT_DIRECTORY = " . $docdir . '/api' .
                "\nINPUT = " . $destdir .
                "\nEXCLUDE = " . $destdir . '/settings' .
                "\nSTRIP_FROM_PATH = " . $destdir, FILE_APPEND );
            $out = pake_sh( $doxygen . ' ' . escapeshellarg( $doxyfile ) );
            pake_remove( $doxyfile, '' );
            // cleanup leftover files, just in case dot tool is not found
            $files = pakeFinder::type( 'file' )->name( array( '*.dot', '*.md5', '*.map', 'installdox' ) )->in( $docdir . '/api' );
            pake_remove( $files, '' );
        }

        SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
    }
static function run_generate_documentation( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        if ( !SharedLock::acquire( $opts['extension']['name'], LOCK_EX, $opts ) )
            throw new PakeException( "Source code locked by another process" );

        $destdir = self::getBuildDir( $opts ) . '/' . $opts['extension']['name'];
        $docdir = $destdir . '/doc';
        $files = pakeFinder::type( 'file' )->name( '*.rst' )->in( $docdir );
        foreach ( $files as $i => $file )
        {
            $dst = substr( $file, 0, -3 ) . 'html';
            $document = new ezcDocumentRst();
            $document->loadFile( $file );
            $docbook = $document->getAsXhtml();
            file_put_contents( $dst, $docbook->save() );
            pake_echo_action( 'file+', $dst );
            pake_remove( $file, '' );
        }

        /*
        * A few extension have Makefiles to generate documentation
        * We remove them as well as the original .rst files
        * NB: this is not done anymore since version 0.1. Use files.to_exclude option instead
        */
        //pake_remove( pakeFinder::type( 'file' )->name( 'Makefile' )->in( $destdir ), '' );

        // doxygen
        if ( $opts['create']['doxygen_doc'] )
        {
            pake_mkdirs( $docdir . '/api' );
            $doxygen = self::getTool( 'doxygen', $opts );
            $doxyfile = $destdir . '/doxyfile';
            pake_copy( self::getResourceDir() . '/doxyfile_master', $doxyfile, array( 'override' => true ) );
            file_put_contents( $doxyfile,
                "\nPROJECT_NAME = " . $opts['extension']['name'] .
                "\nPROJECT_NUMBER = " . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] .
                "\nOUTPUT_DIRECTORY = " . $docdir . '/api' .
                "\nINPUT = " . $destdir .
                "\nEXCLUDE = " . $destdir . '/settings' .
                "\nSTRIP_FROM_PATH = " . $destdir, FILE_APPEND );
            $out = pake_sh( $doxygen . ' ' . escapeshellarg( $doxyfile ) );
            pake_remove( $doxyfile, '' );
            // cleanup leftover files, just in case dot tool is not found
            $files = pakeFinder::type( 'file' )->name( array( '*.dot', '*.md5', '*.map', 'installdox' ) )->in( $docdir . '/api' );
            pake_remove( $files, '' );
        }

        SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
    }
Generates the documentation of the extension, if created in RST format in the doc/ folder, plus optionally
API docs via doxygen; options: --doxygen=/path/to/doxygen

Builds an html file of all doc/*.rst files, and removes the source, then, if
configured in the options file, uses doxygen to create html documentation of
php source code in doc/api. The location of the doxygen binary can be specified
via a configuration option

@todo allow config file to specify doc dir
@todo use local doxygen file if found, instead of std one
@todo create api doc from php files using phpdoc too
example cli cmd: ${phpdocinstall}phpdoc -t ${phpdocdir}/html -ti 'eZ Publish' -pp -s -d lib/ezdb/classes,lib/ezdbschema/classes,lib/ezdiff/classes,lib/ezfile/classes,lib/ezi18n/classes,lib/ezimage/classes,lib/ezlocale/classes,lib/ezmath/classes,lib/ezpdf/classes,lib/ezsession/classes,lib/ezsoap/classes,lib/eztemplate/classes,lib/ezutils/classes,lib/ezxml/classes,kernel/classes,kernel/private/classes,kernel/common,cronjobs,update/common/scripts > ${phpdocdir}/generate.log