예제 #1
0
 /**
  * @param PharComposer $pharcomposer
  * @depends testConstructor
  */
 public function testSetters(PharComposer $pharcomposer)
 {
     $pharcomposer->setMain('example/phar-composer.php');
     $this->assertEquals('example/phar-composer.php', $pharcomposer->getMain());
     $pharcomposer->setTarget('test.phar');
     $this->assertEquals('test.phar', $pharcomposer->getTarget());
     return $pharcomposer;
 }
예제 #2
0
파일: Gui.php 프로젝트: lkdl/phar-composer
 protected function doBuild(Builder $builder, Packager $packager, PharComposer $pharer)
 {
     $pulsate = $builder->pulsate('Waiting for target file name...')->run();
     $save = $builder->fileSave('Location to write file to', $pharer->getTarget());
     $target = $save->waitReturn();
     if ($target === false) {
         return;
     }
     $pulsate->close();
     $pulsate = $builder->pulsate('Building target file...')->run();
     $pharer->setTarget($target);
     $pharer->build();
     $pulsate->close();
 }
예제 #3
0
 public function getSystemBin(PharComposer $pharer, $path = null)
 {
     // no path given => place in system bin path
     if ($path === null) {
         $path = self::PATH_BIN;
     }
     // no slash => path is relative to system bin path
     if (strpos($path, '/') === false) {
         $path = self::PATH_BIN . '/' . $path;
     }
     // TODO: check path is in $PATH environment
     // path is actually a directory => append package name
     if (is_dir($path)) {
         $path = rtrim($path, '/') . '/' . basename($pharer->getTarget(), '.phar');
     }
     return $path;
 }