コード例 #1
0
 /**
  * The main entry point method.
  * This method creates the 'channel.xml' file based on the
  * given parameters.
  */
 public function main()
 {
     $contents = null;
     $p = new JLD_PearTools_Package($contents, $this->propertyPackageFile);
     if (!$p->isValid()) {
         throw new BuildException('package file appears invalid');
     }
     $result = $p->updateFile();
     if (!$result) {
         throw new BuildException('package file could not be updated');
     }
 }
コード例 #2
0
 /**
  * The main entry point method.
  * This method creates the 'channel.xml' file based on the
  * given parameters.
  */
 public function main()
 {
     $contents = null;
     $p = new JLD_PearTools_Package($contents, $this->propertyPackageFile);
     if (!$p->isValid()) {
         throw new BuildException('package file appears invalid');
     }
     $this->project->setProperty($this->propertyPackageName, $p->getName());
     $this->project->setProperty($this->propertyPackageNameL, strtolower($p->getName()));
     $this->project->setProperty($this->propertyPackageVersion, $p->getVersion());
     $this->project->setProperty($this->propertyPackageStability, $p->getStability());
     $this->project->setProperty($this->propertyPackageSummary, $p->getSummary());
     $this->project->setProperty($this->propertyPackageDescription, $p->getDescription());
     $this->project->setProperty($this->propertyPackageDeps, $p->getSerializedDependencies());
     $this->project->setProperty($this->propertyPackageChangelog, $p->getChangelog());
 }
コード例 #3
0
 /**
  * Scans the package's /r REST directory and finds 
  * all releases associated with a package. This is accomplished by reading in
  * all the files of the pattern 'package.$version.xml'
  */
 public function getAllReleases(&$version_list = null)
 {
     $names = $this->getAllPackagesFileNames();
     if (empty($names)) {
         return false;
     }
     $baseDir = $this->buildFileSystemRestPath(self::$baseReleases) . '/' . $this->package_name . '/';
     $all = array();
     $c = null;
     // dummy.
     foreach ($names as $name) {
         $p = new JLD_PearTools_Package($c, $baseDir . $name);
         if (!$p->isValid()) {
             throw new Exception('invalid package.xml file: ' . $baseDir . $name);
         }
         $v = $p->getVersion();
         if (is_array($version_list)) {
             $version_list[] = $v;
         }
         $e['v'] = $v;
         $e['s'] = $p->getStability();
         $all[] = $e;
         $p = null;
     }
     return $all;
 }