private function createStub($dest, $autoloaderFilename = 'autoloader.php')
    {
        $this->startSection('stub');
        $this->debug("Creating phar stub at $dest");

        $alias = basename($dest);
        $constName = str_replace('.phar', '', strtoupper($alias)) . '_PHAR';
        $stub  = "<?php\n";
        $stub .= "define('$constName', true);\n";
        $stub .= "require 'phar://$alias/{$autoloaderFilename}';\n";
        $stub .= "__HALT_COMPILER();\n";
        $this->endSection();

        return $stub;
    }
private function createStub($dest, $autoloaderFilename = 'autoloader.php')
    {
        $this->startSection('stub');
        $this->debug("Creating phar stub at $dest");

        $alias = basename($dest);
        $constName = str_replace('.phar', '', strtoupper($alias)) . '_PHAR';
        $stub  = "<?php\n";
        $stub .= "define('$constName', true);\n";
        $stub .= "require 'phar://$alias/{$autoloaderFilename}';\n";
        $stub .= "__HALT_COMPILER();\n";
        $this->endSection();

        return $stub;
    }
private function createStub ( $ dest , $ autoloaderFilename = 'autoloader.php' ) { $ this -> startSection ( 'stub' ) ; $ this -> debug ( "Creating phar stub at $dest" ) ; $ alias = basename ( $ dest ) ; $ constName = str_replace ( '.phar' , '' , strtoupper ( $ alias ) ) . '_PHAR' ; $ stub = "<?php\n" ; $ stub .= "define('$constName', true);\n" ; $ stub .= "require 'phar://$alias/{$autoloaderFilename}';\n" ; $ stub .= "__HALT_COMPILER();\n" ; $ this -> endSection ( ) ; return $ stub ; }
Creates a default stub for the phar that includeds the generated
autoloader.

This phar also registers a constant that can be used to check if you
are running the phar. The constant is the basename of the $dest variable
without the extension, with "_PHAR" appended, then converted to all
caps (e.g., "/foo/guzzle.phar" gets a contant defined as GUZZLE_PHAR.

@param $dest
@param string $autoloaderFilename Name of the autoloader file.

@return string
Creates a default stub for the phar that includeds the generated autoloader .