classes/BuildTasks.php
static function run_check_php_files( $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( '*.php' ) )->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" );
            }

            foreach ( pakeFinder::type( 'file' )->name( array( '*.php' ) )->in( $destdir ) as $file )
            {
                if ( strpos( pake_sh( $php . " -l " . escapeshellarg( $file ) ), 'No syntax errors detected' ) === false )
                {
                    SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                    throw new pakeException( "$file does not seem to be a valid php file" );
                }
            }
        }

        SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
    }
static function run_check_php_files( $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( '*.php' ) )->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" );
            }

            foreach ( pakeFinder::type( 'file' )->name( array( '*.php' ) )->in( $destdir ) as $file )
            {
                if ( strpos( pake_sh( $php . " -l " . escapeshellarg( $file ) ), 'No syntax errors detected' ) === false )
                {
                    SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
                    throw new pakeException( "$file does not seem to be a valid php file" );
                }
            }
        }

        SharedLock::release( $opts['extension']['name'], LOCK_SH, $opts );
    }
Checks for validity all php files; use config options to specify the path to php executable if needed