示例#1
0
 public function build()
 {
     $builder = new PharBuilder($this->config->name);
     foreach ($this->config->files as $file) {
         $builder->addFile($file, getcwd() . '/' . $file);
     }
     if ($this->config->main) {
         $builder->addFile($this->config->main, getcwd() . '/' . $this->config->main);
         $builder->mainScript($this->config->main);
     }
     $builder->build();
     return $this->config->name;
 }
示例#2
0
/**
 *  @Cli("build", "Build script")
 *  @Arg("path", OPTIONAL)
 */
function main($input, $output)
{
    PharBuilder::checkCanCreatePhar();
    $path = get_path($input->getArgument('path') ?: 'spec.yml');
    $build = new BuildFile($path);
    $output->writeLn("<info>Write phar using {$path}</info>");
    $output->writeLn("<info>Created " . $build->build() . "</info>");
}