Example #1
0
 function makePackage(\PEAR2\Pyrus\PackageFile\v2 $pf)
 {
     foreach ($pf->files as $name => $blah) {
         file_put_contents($this->__DIR__ . '/' . $name, 'hi');
     }
     file_put_contents($this->__DIR__ . '/package.xml', $pf);
     $package1 = new \PEAR2\Pyrus\Package(false);
     $xmlcontainer = new \PEAR2\Pyrus\PackageFile($pf);
     $xml = new \PEAR2\Pyrus\Package\Xml($this->__DIR__ . '/package.xml', $package1, $xmlcontainer);
     $package1->setInternalPackage($xml);
     $package1->archivefile = $this->__DIR__ . '/package.xml';
     $this->scs->saveRelease($package1, 'cellog');
     foreach ($pf->files as $name => $blah) {
         unlink($this->__DIR__ . '/' . $name);
     }
     unlink($this->__DIR__ . '/package.xml');
 }
Example #2
0
$pf->channel = 'pear2.php.net';
$pf->summary = 'testing';
$pf->version['release'] = '1.0.0';
$pf->stability['release'] = 'stable';
$pf->description = 'hi description';
$pf->notes = 'my notes';
$pf->maintainer['cellog']->role('lead')->email('*****@*****.**')->active('yes')->name('Greg Beaver');
$pf->files['glooby1'] = array('role' => 'php');

$pf->setPackagefile(__DIR__ . '/package.xml');

file_put_contents(__DIR__ . '/package.xml', $pf);

$package1 = new \PEAR2\Pyrus\Package(false);
$xmlcontainer = new \PEAR2\Pyrus\PackageFile($pf);
$xml = new \PEAR2\Pyrus\Package\Xml(__DIR__ . '/package.xml', $package1, $xmlcontainer);
$package1->setInternalPackage($xml);
$package1->archivefile = __DIR__ . '/package.xml';
$scs->saveRelease($package1, 'cellog', $cert[0], $cert[1]);

// clean up
unlink(dirname(__DIR__) . '/pearconfig.xml');
unlink(dirname(__DIR__) . '/.config');
for ($i = 1; $i <= 1; $i++) {
    unlink(__DIR__ . "/glooby$i");
}
unlink(__DIR__ . '/package.xml');
$dir = dirname(__DIR__) . '/.configsnapshots';
include __DIR__ . '/../../../clean.php.inc';
rmdir(dirname(__DIR__) . '/PEAR2/temp');
Example #3
0
 function validate()
 {
     $package = new \PEAR2\Pyrus\Package(false);
     $xmlcontainer = new \PEAR2\Pyrus\PackageFile($this->pxml);
     $xml = new \PEAR2\Pyrus\Package\Xml($this->path . '/package.xml', $package, $xmlcontainer);
     $package->setInternalPackage($xml);
     $this->pxml->getValidator()->validate($package);
 }
Example #4
0
    public function installCustomRole()
    {
        $pf = new \PEAR2\Pyrus\PackageFile\v2;

        $pf->name = 'PyrusBundlePlugin';
        $pf->channel = 'pear2.php.net';
        $pf->summary = 'Local';
        $pf->description = 'Description';
        $pf->notes = 'My Notes';
        $pf->maintainer['naderman']->role('lead')->email('*****@*****.**')->active('yes')->name('Nils Adermann');
        $pf->files['Bundle.xml'] = array(
            'attribs' => array('role' => 'customrole'),
        );
        $pf->files['PyrusBundlePlugin/Role/Bundle.php'] = array(
            'attribs' => array('role' => 'php'),
        );

        $package_xml = __DIR__ . '/plugin/package.xml';
        $pf->setPackagefile($package_xml);

        $package = new \PEAR2\Pyrus\Package(false);
        $xmlcontainer = new \PEAR2\Pyrus\PackageFile($pf);
        $xml = new \PEAR2\Pyrus\Package\Xml($package_xml, $package, $xmlcontainer);
        $package->setInternalPackage($xml);
        \PEAR2\Pyrus\Main::$options['install-plugins'] = true;

        \PEAR2\Pyrus\Installer::begin();
        \PEAR2\Pyrus\Installer::prepare($package);
        \PEAR2\Pyrus\Installer::commit();

        $this->readConfig();
    }