static function run_update_ezinfo( $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'];

        $files = pakeFinder::type( 'file' )->name( 'ezinfo.php' )->maxdepth( 0 );

        /// @todo use a real php parser instead
        pake_replace_regexp( $files, $destdir, array(
                '/^([\s]{1,25}\x27Version\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] . '$3',
                '/^([\s]{1,25}\x27License\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $opts['version']['license'] . '$3' ),
            1 );

        $files = pakeFinder::type( 'file' )->maxdepth( 0 )->name( 'extension.xml' );
        /// @todo use a real xml parser instead
        pake_replace_regexp( $files, $destdir, array(
                '#^([\s]{1,8}<version>)([^<]*)(</version>\r?\n?)#m' => '${1}' . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] . '$3',
                /// @bug we should use a better xml escaping here
                '#^([\s]{1,8}<license>)([^<]*)(</license>\r?\n?)#m' => '${1}' . htmlspecialchars( $opts['version']['license'] ) . '$3',
                '#^([\s]{1,8}<copyright>)Copyright \(C\) 1999-[\d]{4} eZ Systems AS(</copyright>\r?\n?)#m' => '${1}' . 'Copyright (C) 1999-' . strftime( '%Y' ). ' eZ Systems AS' . '$2' ),
            1 );

        SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
    }
static function run_update_ezinfo( $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'];

        $files = pakeFinder::type( 'file' )->name( 'ezinfo.php' )->maxdepth( 0 );

        /// @todo use a real php parser instead
        pake_replace_regexp( $files, $destdir, array(
                '/^([\s]{1,25}\x27Version\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] . '$3',
                '/^([\s]{1,25}\x27License\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $opts['version']['license'] . '$3' ),
            1 );

        $files = pakeFinder::type( 'file' )->maxdepth( 0 )->name( 'extension.xml' );
        /// @todo use a real xml parser instead
        pake_replace_regexp( $files, $destdir, array(
                '#^([\s]{1,8}<version>)([^<]*)(</version>\r?\n?)#m' => '${1}' . $opts['version']['alias'] . $opts['releasenr']['separator'] . $opts['version']['release'] . '$3',
                /// @bug we should use a better xml escaping here
                '#^([\s]{1,8}<license>)([^<]*)(</license>\r?\n?)#m' => '${1}' . htmlspecialchars( $opts['version']['license'] ) . '$3',
                '#^([\s]{1,8}<copyright>)Copyright \(C\) 1999-[\d]{4} eZ Systems AS(</copyright>\r?\n?)#m' => '${1}' . 'Copyright (C) 1999-' . strftime( '%Y' ). ' eZ Systems AS' . '$2' ),
            1 );

        SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
    }
static function run_update_ezinfo ( $ 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' ] ; $ files = pakeFinder :: type ( 'file' ) -> name ( 'ezinfo.php' ) -> maxdepth ( 0 ) ; /// @todo use a real php parser instead
 pake_replace_regexp ( $ files , $ destdir , array ( '/^([\s]{1,25}\x27Version\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $ opts [ 'version' ] [ 'alias' ] . $ opts [ 'releasenr' ] [ 'separator' ] . $ opts [ 'version' ] [ 'release' ] . '$3' , '/^([\s]{1,25}\x27License\x27[\s]+=>[\s]+[\x27\x22])(.*)([\x27\x22],?\r?\n?)/m' => '${1}' . $ opts [ 'version' ] [ 'license' ] . '$3' ) , 1 ) ; $ files = pakeFinder :: type ( 'file' ) -> maxdepth ( 0 ) -> name ( 'extension.xml' ) ; /// @todo use a real xml parser instead
 pake_replace_regexp ( $ files , $ destdir , array ( '#^([\s]{1,8}<version>)([^<]*)(</version>\r?\n?)#m' => '${1}' . $ opts [ 'version' ] [ 'alias' ] . $ opts [ 'releasenr' ] [ 'separator' ] . $ opts [ 'version' ] [ 'release' ] . '$3' , /// @bug we should use a better xml escaping here
 '#^([\s]{1,8}<license>)([^<]*)(</license>\r?\n?)#m' => '${1}' . htmlspecialchars ( $ opts [ 'version' ] [ 'license' ] ) . '$3' , '#^([\s]{1,8}<copyright>)Copyright \(C\) 1999-[\d]{4} eZ Systems AS(</copyright>\r?\n?)#m' => '${1}' . 'Copyright (C) 1999-' . strftime ( '%Y' ) . ' eZ Systems AS' . '$2' ) , 1 ) ; SharedLock :: release ( $ opts [ 'extension' ] [ 'name' ] , LOCK_EX , $ opts ) ; }
Updates the ezinfo.php and extension.xml files with the version number and
license tag from configuration.

Uses a regular expression to search and replace the correct strings in ezinfo.php
Within the file, please note there is a limit of 25 spaces to avoid indenting
3rd party lib version numbers, if you use more than 25 spaces the version number
and license string will not be updated correctly.
Also we set a limit of 1 replacement, to avoid fixing 3rd party lib versions.

For the extension.xml file, max indentation is set to 8 chars.
Updates the ezinfo . php and extension . xml files with the version number and license tag from configuration .