public function createPhar(
        $dest,
        $stub = null,
        $autoloaderFilename = 'autoloader.php'
    ) {
        $this->startSection('phar');
        $this->debug("Creating phar file at $dest");
        $this->createDirIfNeeded(dirname($dest));
        $phar = new \Phar($dest, 0, basename($dest));
        $phar->buildFromDirectory($this->stageDir);

        if ($stub !== false) {
            if (!$stub) {
                $stub = $this->createStub($dest, $autoloaderFilename);
            }
            $phar->setStub($stub);
        }

        $this->debug("Created phar at $dest");
        $this->endSection();
    }
public function createPhar(
        $dest,
        $stub = null,
        $autoloaderFilename = 'autoloader.php'
    ) {
        $this->startSection('phar');
        $this->debug("Creating phar file at $dest");
        $this->createDirIfNeeded(dirname($dest));
        $phar = new \Phar($dest, 0, basename($dest));
        $phar->buildFromDirectory($this->stageDir);

        if ($stub !== false) {
            if (!$stub) {
                $stub = $this->createStub($dest, $autoloaderFilename);
            }
            $phar->setStub($stub);
        }

        $this->debug("Created phar at $dest");
        $this->endSection();
    }
public function createPhar ( $ dest , $ stub = null , $ autoloaderFilename = 'autoloader.php' ) { $ this -> startSection ( 'phar' ) ; $ this -> debug ( "Creating phar file at $dest" ) ; $ this -> createDirIfNeeded ( dirname ( $ dest ) ) ; $ phar = new \ Phar ( $ dest , 0 , basename ( $ dest ) ) ; $ phar -> buildFromDirectory ( $ this -> stageDir ) ; if ( $ stub !== false ) { if ( ! $ stub ) { $ stub = $ this -> createStub ( $ dest , $ autoloaderFilename ) ; } $ phar -> setStub ( $ stub ) ; } $ this -> debug ( "Created phar at $dest" ) ; $ this -> endSection ( ) ; }
Creates a phar that automatically registers an autoloader.

Call this only after your staging directory is built.

@param string $dest Where to save the file. The basename of the file
is also used as the alias name in the phar
(e.g., /path/to/guzzle.phar => guzzle.phar).
@param string|bool|null $stub The path to the phar stub file. Pass or
leave null to automatically have one created for you. Pass false
to no use a stub in the generated phar.
@param string $autoloaderFilename Name of the autolaoder filename.
Creates a phar that automatically registers an autoloader .