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

        $destdir = self::getBuildDir( $opts ) . '/' . $opts['extension']['name'];
        $files = pakeFinder::type( 'file' )->name( array( '*.tpl' ) )->maxdepth( 0 )->in( $destdir );
        if ( count( $files ) )
        {
            $php = self::getTool( 'php', $opts );
            if ( strpos( pake_sh( $php . " -v" ), 'PHP' ) === false )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( "$php does not seem to be a valid php executable" );
            }

            $ezp = @$opts['ezublish']['install_dir_LS'];
            if ( $ezp == '' )
            {
                // assume we're running inside an eZ installation
                $ezp = '../..';
            }
            if ( !file_exists( $ezp . '/bin/php/eztemplatecheck.php' ) )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( "$ezp does not seem to be a valid eZ Publish install" );
            }

            // get absolute path to build dir
            $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
            $rootpath = dirname( $rootpath[0] );
            $out = pake_sh( "cd " . escapeshellarg( $ezp ) . " && " . escapeshellarg( $php ) . " bin/php/eztemplatecheck.php " . escapeshellarg( $rootpath ) );
            if ( strpos( $out, 'Some templates did not validate' ) !== false )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( $out );
            }
        }

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

        $destdir = self::getBuildDir( $opts ) . '/' . $opts['extension']['name'];
        $files = pakeFinder::type( 'file' )->name( array( '*.tpl' ) )->maxdepth( 0 )->in( $destdir );
        if ( count( $files ) )
        {
            $php = self::getTool( 'php', $opts );
            if ( strpos( pake_sh( $php . " -v" ), 'PHP' ) === false )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( "$php does not seem to be a valid php executable" );
            }

            $ezp = @$opts['ezublish']['install_dir_LS'];
            if ( $ezp == '' )
            {
                // assume we're running inside an eZ installation
                $ezp = '../..';
            }
            if ( !file_exists( $ezp . '/bin/php/eztemplatecheck.php' ) )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( "$ezp does not seem to be a valid eZ Publish install" );
            }

            // get absolute path to build dir
            $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
            $rootpath = dirname( $rootpath[0] );
            $out = pake_sh( "cd " . escapeshellarg( $ezp ) . " && " . escapeshellarg( $php ) . " bin/php/eztemplatecheck.php " . escapeshellarg( $rootpath ) );
            if ( strpos( $out, 'Some templates did not validate' ) !== false )
            {
                SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                throw new pakeException( $out );
            }
        }

        SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
    }
static function run_check_templates ( $ task = null , $ args = array ( ) , $ cliopts = array ( ) ) { $ opts = self :: getOpts ( @ $ args [ 0 ] , @ $ args [ 1 ] , $ cliopts ) ; if ( ! SharedLock :: acquire ( $ opts [ 'extension' ] [ 'name' ] , LOCK_SH , $ opts ) ) throw new PakeException ( "Source code locked by another process" ) ; $ destdir = self :: getBuildDir ( $ opts ) . '/' . $ opts [ 'extension' ] [ 'name' ] ; $ files = pakeFinder :: type ( 'file' ) -> name ( array ( '*.tpl' ) ) -> maxdepth ( 0 ) -> in ( $ destdir ) ; if ( count ( $ files ) ) { $ php = self :: getTool ( 'php' , $ opts ) ; if ( strpos ( pake_sh ( $ php . " -v" ) , 'PHP' ) === false ) { SharedLock :: release ( $ opts [ 'extension' ] [ 'name' ] , LOCK_SH , $ opts ) ; throw new pakeException ( "$php does not seem to be a valid php executable" ) ; } $ ezp = @ $ opts [ 'ezublish' ] [ 'install_dir_LS' ] ; if ( $ ezp == '' ) { // assume we're running inside an eZ installation
 $ ezp = '../..' ; } if ( ! file_exists ( $ ezp . '/bin/php/eztemplatecheck.php' ) ) { SharedLock :: release ( $ opts [ 'extension' ] [ 'name' ] , LOCK_SH , $ opts ) ; throw new pakeException ( "$ezp does not seem to be a valid eZ Publish install" ) ; } // get absolute path to build dir
 $ rootpath = pakeFinder :: type ( 'directory' ) -> name ( $ opts [ 'extension' ] [ 'name' ] ) -> in ( self :: getBuildDir ( $ opts ) ) ; $ rootpath = dirname ( $ rootpath [ 0 ] ) ; $ out = pake_sh ( "cd " . escapeshellarg ( $ ezp ) . " && " . escapeshellarg ( $ php ) . " bin/php/eztemplatecheck.php " . escapeshellarg ( $ rootpath ) ) ; if ( strpos ( $ out , 'Some templates did not validate' ) !== false ) { SharedLock :: release ( $ opts [ 'extension' ] [ 'name' ] , LOCK_SH , $ opts ) ; throw new pakeException ( $ out ) ; } } SharedLock :: release ( $ opts [ 'extension' ] [ 'name' ] , LOCK_SH , $ opts ) ; }
Checks for validity all template files - needs a working eZP install somewhere to get the tpl syntax checker script;
use config options to specify the path to php executable if needed, as well as the path to an
eZPublish installation
Checks for validity all template files - needs a working eZP install somewhere to get the tpl syntax checker script ; use config options to specify the path to php executable if needed as well as the path to an eZPublish installation