示例#1
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $mssg = preg_replace("/\\s/", " ", substr($this->summary, 0, 50));
     $handler->buildMessage(5, "Setting summary... {$mssg}..", true);
     $package->setSummary($this->summary);
 }
示例#2
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting license name... {$this->name}", true);
     $handler->buildMessage(5, "Setting license uri... {$this->uri}", true);
     $package->setLicense($this->name, $this->uri);
 }
示例#3
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting API version... {$this->version}", true);
     $handler->buildMessage(5, "Setting API stability... {$this->stability}", true);
     $package->setAPIVersion($this->version);
     $package->setAPIStability($this->stability);
 }
示例#4
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Add install group " . strtolower($this->name) . "...", true);
     //
     $postInstall = $package->getPostinstaller();
     $params = array();
     foreach ($this->params as $num => $param) {
         $params[] = $param->getArray($postInstall);
     }
     $package->addPostInstallGroup($this->name);
     $postInstall->addParamGroup($this->name, $params, $this->instructions);
 }
示例#5
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting minimum version of PEAR Installer... {$this->min}", true);
     $package->setPearinstallerDep($this->min);
 }
示例#6
0
文件: Role.php 项目: nequal/Openpear
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Add role... {$this->extension} => {$this->role}", true);
     $package->addRole($this->extension, $this->role);
 }
示例#7
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting channel... {$this->channel}", true);
     $package->setChannel($this->channel);
 }
示例#8
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Add " . strtolower($this->type) . " dependency package ... {$this->channel}/{$this->name}", true);
     $package->addPackageDepWithChannel($this->type, $this->name, $this->channel, $this->min, $this->max, $this->recommended, $this->exclude, $this->providesextension, $this->nodefault);
 }
示例#9
0
文件: Root.php 项目: nequal/Openpear
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $package->setPackageOption('packagedirectory', $this->getName());
 }
示例#10
0
文件: Roles.php 项目: nequal/Openpear
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     foreach ($this->roles as $num => $value) {
         $package->accept($value);
     }
 }
示例#11
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     //
     $dir = $package->getPackageDirectory();
     $fullpath = realpath($dir . '/' . $this->path);
     //
     if (true === $this->_getAttr('ignore')) {
         $handler->buildMessage(5, "Add attribute 'ignore' of [{$this->path}]... yes", true);
         if (is_dir($fullpath)) {
             $package->addIgnore($fullpath . DIRECTORY_SEPARATOR . '*');
         } else {
             $package->addIgnore($fullpath);
         }
     }
     //
     $role = $this->_getAttr('role');
     if (!is_null($role)) {
         $handler->buildMessage(5, "Add attribute 'role' of [{$this->path}]... {$role}", true);
         if (is_dir($fullpath)) {
             $package->addDirectoryRole($this->path, $role);
         } else {
             $package->addExceptions($this->path, $role);
         }
     }
     //
     $platform = $this->_getAttr('platform');
     if (!is_null($platform)) {
         $handler->buildMessage(5, "Add attribute 'platform' of [{$this->path}]... {$platform}", true);
         $package->addPlatformExceptions($this->path, $platform);
     }
     //
     $install = $this->_getAttr('install');
     if (!is_null($install)) {
         $handler->buildMessage(5, "Add attribute 'install' of [{$this->path}]... {$install}", true);
         $package->addInstallAs($this->path, $install);
         $package->addInstallExceptions($this->path, '/');
     }
     //
     $replace = $this->_getAttr('replace');
     if (is_array($replace)) {
         foreach ($replace as $type => $value) {
             foreach ($value as $from => $to) {
                 $handler->buildMessage(5, "Add attribute 'replace' of [{$this->path}]... {$from} => {$type}::{$to}", true);
                 $package->addReplacement($this->path, $type, $from, $to);
             }
         }
     }
 }
示例#12
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Add " . strtolower($this->role) . " maintainer... *{$this->handle}*  {$this->name}<{$this->email}>", true);
     $package->addMaintainer($this->role, $this->handle, $this->name, $this->email);
 }
示例#13
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting package type... {$this->type}", true);
     $package->setPackageType($this->type);
 }
示例#14
0
 /**
  *
  */
 private function _buildProject()
 {
     //
     if (!$this->ProjectDirectory->loadSetting($this->ProjectInfo, 0)) {
         return;
     }
     $package = new PEAR_PackageProjector_Package();
     $oldcwd = getcwd();
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     //
     try {
         chdir($this->ProjectDirectory->getSrcPath());
         /*
          * Create package2.xml
          */
         $handler->buildMessage(5, "*** Create package2.xml ***", true);
         //
         $package->accept($this->ProjectDirectory->getPackageDirectory());
         $package->accept($this->ProjectInfo);
         $package->build();
         $handler->buildMessage(5, "", true);
         /*
          * Create Tgz
          */
         $handler->buildMessage(5, "*** Create Tgz File ***", true);
         //
         chdir($this->ProjectDirectory->getRelasePath());
         $pkg = new PEAR_PackageProjector_Packager();
         $pkg->setMessageHandler($handler);
         $pkg->package($this->ProjectDirectory->getPackageFile());
         $handler->buildMessage(5, "", true);
     } catch (Exception $e) {
         chdir($oldcwd);
         $handler->buildMessage(5, "\n*** Stop for the exception was generated.  ***", true);
         throw $e;
     }
     $handler->buildMessage(5, "*** Finish ***", true);
     //
     chdir($oldcwd);
     //
     return true;
 }
示例#15
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     //
     foreach ($this->items as $key => $item) {
         $package->accept($item);
     }
     //
     $package->accept($this->Roles);
     $package->accept($this->Maintainers);
     $package->accept($this->AttributeManager);
     $package->accept($this->Dependencies);
     $package->accept($this->InstallGroups);
 }
示例#16
0
 /**
  *
  */
 public function visit(PEAR_PackageProjector_Package $package)
 {
     $handler = PEAR_PackageProjector::singleton()->getMessageHandler();
     $handler->buildMessage(5, "Setting base install directory... {$this->dir}", true);
     $package->setPackageOption('baseinstalldir', $this->dir);
 }