Ejemplo n.º 1
0
 public function configure()
 {
     $this->environment->registerChannel('pear.example.com', true);
     $mainPackage = new PEAR_PackageFile_v2_rw();
     $mainPackage->setPackage('sfMainPackage');
     $mainPackage->setChannel('pear.example.com');
     $mainPackage->setConfig($this->environment->getConfig());
     $mainPackage->setPackageType('php');
     $mainPackage->setAPIVersion('1.0.0');
     $mainPackage->setAPIStability('stable');
     $mainPackage->setReleaseVersion($this->mainPackageVersion);
     $mainPackage->setReleaseStability('stable');
     $mainPackage->setDate(date('Y-m-d'));
     $mainPackage->setDescription('sfMainPackage');
     $mainPackage->setSummary('sfMainPackage');
     $mainPackage->setLicense('MIT License');
     $mainPackage->clearContents();
     $mainPackage->resetFilelist();
     $mainPackage->addMaintainer('lead', 'fabpot', 'Fabien Potencier', '*****@*****.**');
     $mainPackage->setNotes('-');
     $mainPackage->setPearinstallerDep('1.4.3');
     $mainPackage->setPhpDep('5.1.0');
     $this->environment->getRegistry()->deletePackage('sfMainPackage', 'pear.example.com');
     if (!$this->environment->getRegistry()->addPackage2($mainPackage)) {
         throw new sfException('Unable to register our sfMainPackage');
     }
 }
 /**
  * Registers the symfony package for the current version.
  */
 protected function registerSymfonyPackage()
 {
     $symfony = new PEAR_PackageFile_v2_rw();
     $symfony->setPackage('symfony');
     $symfony->setChannel('pear.symfony-project.com');
     $symfony->setConfig($this->environment->getConfig());
     $symfony->setPackageType('php');
     $symfony->setAPIVersion(preg_replace('/\\d+(\\-\\w+)?$/', '0', SYMFONY_VERSION));
     $symfony->setAPIStability(false === strpos(SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta');
     $symfony->setReleaseVersion(preg_replace('/\\-\\w+$/', '', SYMFONY_VERSION));
     $symfony->setReleaseStability(false === strpos(SYMFONY_VERSION, 'DEV') ? 'stable' : 'beta');
     $symfony->setDate(date('Y-m-d'));
     $symfony->setDescription('symfony');
     $symfony->setSummary('symfony');
     $symfony->setLicense('MIT License');
     $symfony->clearContents();
     $symfony->resetFilelist();
     $symfony->addMaintainer('lead', 'fabpot', 'Fabien Potencier', '*****@*****.**');
     $symfony->setNotes('-');
     $symfony->setPearinstallerDep('1.4.3');
     $symfony->setPhpDep('5.2.4');
     $this->environment->getRegistry()->deletePackage('symfony', 'pear.symfony-project.com');
     if (!$this->environment->getRegistry()->addPackage2($symfony)) {
         throw new sfPluginException('Unable to register the symfony package');
     }
 }
Ejemplo n.º 3
0
 protected function registerOpenPNEPackage()
 {
     $openpne = new PEAR_PackageFile_v2_rw();
     $openpne->setPackage('openpne');
     $openpne->setChannel('plugins.openpne.jp');
     $openpne->setConfig($this->environment->getConfig());
     $openpne->setPackageType('php');
     $openpne->setAPIVersion(preg_replace('/\\d+(\\-\\w+)?$/', '0', OPENPNE_VERSION));
     $openpne->setAPIStability(false === strpos(OPENPNE_VERSION, 'dev') ? 'stable' : 'beta');
     $openpne->setReleaseVersion(str_replace('-', '', OPENPNE_VERSION));
     $openpne->setReleaseStability(false === strpos(OPENPNE_VERSION, 'dev') ? 'stable' : 'beta');
     $openpne->setDate(date('Y-m-d'));
     $openpne->setDescription('openpne');
     $openpne->setSummary('openpne');
     $openpne->setLicense('Apache License');
     $openpne->clearContents();
     $openpne->resetFilelist();
     $openpne->addMaintainer('lead', 'ebihara', 'Kousuke Ebihara', '*****@*****.**');
     $openpne->setNotes('-');
     $openpne->setPearinstallerDep('1.4.3');
     $openpne->setPhpDep('5.2.3');
     // This is a stupid hack. This makes a validator skip validation because that validator
     // doesn't support 3.X.X-betaX-dev formatted version number. Validation of dummy OpenPNE
     // package doesn't make a sense...
     $openpne->_isValid = PEAR_VALIDATE_NORMAL;
     $this->environment->getRegistry()->deletePackage('openpne', 'plugins.openpne.jp');
     if (!$this->environment->getRegistry()->addPackage2($openpne)) {
         throw new sfPluginException('Unable to register the OpenPNE package');
     }
 }
 protected function registerOpenPNEPackage()
 {
     $symfony = new PEAR_PackageFile_v2_rw();
     $symfony->setPackage('openpne');
     $symfony->setChannel('plugins.openpne.jp');
     $symfony->setConfig($this->environment->getConfig());
     $symfony->setPackageType('php');
     $symfony->setAPIVersion(preg_replace('/\\d+(\\-\\w+)?$/', '0', OPENPNE_VERSION));
     $symfony->setAPIStability(false === strpos(OPENPNE_VERSION, 'dev') ? 'stable' : 'beta');
     $symfony->setReleaseVersion(str_replace('-', '', OPENPNE_VERSION));
     $symfony->setReleaseStability(false === strpos(OPENPNE_VERSION, 'dev') ? 'stable' : 'beta');
     $symfony->setDate(date('Y-m-d'));
     $symfony->setDescription('openpne');
     $symfony->setSummary('openpne');
     $symfony->setLicense('Apache License');
     $symfony->clearContents();
     $symfony->resetFilelist();
     $symfony->addMaintainer('lead', 'ebihara', 'Kousuke Ebihara', '*****@*****.**');
     $symfony->setNotes('-');
     $symfony->setPearinstallerDep('1.4.3');
     $symfony->setPhpDep('5.2.3');
     $this->environment->getRegistry()->deletePackage('openpne', 'plugins.openpne.jp');
     if (!$this->environment->getRegistry()->addPackage2($symfony)) {
         throw new sfPluginException('Unable to register the OpenPNE package');
     }
 }
Ejemplo n.º 5
0
 /**
  * Retrieve a brand new package.xml based on the package info
  *
  * @return PEAR_PackageFile_v2_rw
  */
 function getBlankPackage()
 {
     require_once 'PEAR/Validate.php';
     include_once 'pear-database-package.php';
     $info = package::info($this->_package);
     $maintainers = package::info($this->_package, 'authors');
     $pf = new PEAR_PackageFile_v2_rw();
     $pf->setPackage($this->_package);
     $pf->setChannel('pear.php.net');
     $pf->setSummary($info['summary']);
     $pf->setDescription($info['description']);
     foreach ($maintainers as $maintainer) {
         $pf->addMaintainer($maintainer['role'], $maintainer['handle'], $maintainer['name'], $maintainer['email'], $maintainer['active'] ? 'yes' : 'no');
     }
     $pf->setReleaseVersion('0.1.0');
     $pf->setAPIVersion('0.1.0');
     $pf->setReleaseStability('alpha');
     $pf->setAPIStability('alpha');
     $pf->setPackageType('php');
     $licensemap = array('php' => 'http://www.php.net/license', 'php license' => 'http://www.php.net/license', 'lgpl' => 'http://www.gnu.org/copyleft/lesser.html', 'bsd' => 'http://www.opensource.org/licenses/bsd-license.php', 'bsd license' => 'http://www.opensource.org/licenses/bsd-license.php', 'bsd style' => 'http://www.opensource.org/licenses/bsd-license.php', 'bsd-style' => 'http://www.opensource.org/licenses/bsd-license.php', 'mit' => 'http://www.opensource.org/licenses/mit-license.php', 'gpl' => 'http://www.gnu.org/copyleft/gpl.html', 'apache' => 'http://www.opensource.org/licenses/apache2.0.php');
     if (isset($licensemap[strtolower($info['license'])])) {
         $uri = $licensemap[strtolower($info['license'])];
     } else {
         $uri = false;
     }
     $pf->setLicense($info['license'], $uri);
     $pf->clearContents();
     $pf->addFile('/', 'ADDFILESHERE', array('name' => 'ADDFILESHERE', 'role' => 'php'));
     $pf->setPhpDep('4.3.0');
     $pf->setPearinstallerDep('1.5.4');
     $pf->addRelease();
     return $pf;
 }
Ejemplo n.º 6
0
 /**
  * registerSymfonyPackage
  *
  * Copied from sfSymfonyPluginManager::registerSymfonyPackage() and changed symfony version
  * that is reported to PEAR installer to 1.9.9 because plugin installer tries downloading the
  * newest stable version of symfony every-time even if the project has the own symfony.
  * OpenPNE is distributed with the own symfony so this behavior is just cumber.
  * For bypassing from downloading symfony, OpenPNE cheats about its symfony version.
  * The last symfony 1.x is 1.4.x. Probably 1.9.9 will be never released.
  */
 protected function registerSymfonyPackage()
 {
     $symfony = new PEAR_PackageFile_v2_rw();
     $symfony->setPackage('symfony');
     $symfony->setChannel('pear.symfony-project.com');
     $symfony->setConfig($this->environment->getConfig());
     $symfony->setPackageType('php');
     $symfony->setAPIVersion('1.1.0');
     $symfony->setAPIStability('stable');
     $symfony->setReleaseVersion('1.9.9');
     $symfony->setReleaseStability('stable');
     $symfony->setDate(date('Y-m-d'));
     $symfony->setDescription('symfony');
     $symfony->setSummary('symfony');
     $symfony->setLicense('MIT License');
     $symfony->clearContents();
     $symfony->resetFilelist();
     $symfony->addMaintainer('lead', 'fabpot', 'Fabien Potencier', '*****@*****.**');
     $symfony->setNotes('-');
     $symfony->setPearinstallerDep('1.4.3');
     $symfony->setPhpDep('5.1.0');
     $this->environment->getRegistry()->deletePackage('symfony', 'pear.symfony-project.com');
     if (!$this->environment->getRegistry()->addPackage2($symfony)) {
         throw new sfPluginException('Unable to register the symfony package');
     }
 }