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;
    }