classes/BuildTasks.php
static function run_fat_dist( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        pake_mkdirs( $opts['dist']['dir'] );
        $files = pakeFinder::type( 'any' )->in( self::getBuildDir( $opts ) );
        // get absolute path to build dir
        $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
        $rootpath = dirname( $rootpath[0] );
        $target = $opts['dist']['dir'] . '/' . $opts['extension']['name'] . '-' . $opts['version']['alias'] . '.' . $opts['version']['release'] . '-bundle.tar';
        // we do not rely on this, not to depend on phar extension and also because it's slightly buggy if there are dots in archive file name
        //pakeArchive::createArchive( $files, $opts['build']['dir'], $target, true );
        $tar = ezcArchive::open( $target, ezcArchive::TAR );
        $tar->appendToCurrent( $files, $rootpath );
        $tar->close();
        $fp = fopen( 'compress.zlib://' . $target . '.gz', 'wb9' );
        /// @todo read file by small chunks to avoid memory exhaustion
        fwrite( $fp, file_get_contents( $target ) );
        fclose( $fp );
        unlink( $target );
        pake_echo_action( 'file+', $target . '.gz' );
    }
static function run_fat_dist( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        pake_mkdirs( $opts['dist']['dir'] );
        $files = pakeFinder::type( 'any' )->in( self::getBuildDir( $opts ) );
        // get absolute path to build dir
        $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
        $rootpath = dirname( $rootpath[0] );
        $target = $opts['dist']['dir'] . '/' . $opts['extension']['name'] . '-' . $opts['version']['alias'] . '.' . $opts['version']['release'] . '-bundle.tar';
        // we do not rely on this, not to depend on phar extension and also because it's slightly buggy if there are dots in archive file name
        //pakeArchive::createArchive( $files, $opts['build']['dir'], $target, true );
        $tar = ezcArchive::open( $target, ezcArchive::TAR );
        $tar->appendToCurrent( $files, $rootpath );
        $tar->close();
        $fp = fopen( 'compress.zlib://' . $target . '.gz', 'wb9' );
        /// @todo read file by small chunks to avoid memory exhaustion
        fwrite( $fp, file_get_contents( $target ) );
        fclose( $fp );
        unlink( $target );
        pake_echo_action( 'file+', $target . '.gz' );
    }
Creates a tarball of all extensions in the build/ directory

@todo add locking support