Exemple #1
0
 function getPassablePf($name, $version, $state = 'stable')
 {
     $pf = new \Pyrus\PackageFile\v2();
     $pf->name = $name;
     $pf->channel = 'pear2.php.net';
     $pf->summary = 'testing';
     $pf->version['release'] = $version;
     $pf->stability['release'] = $state;
     $pf->description = 'hi description';
     $pf->notes = 'my notes';
     $pf->maintainer['cellog']->role('lead')->email('*****@*****.**')->active('yes')->name('Greg Beaver');
     $pf->setPackagefile($this->__DIR__ . '/package.xml');
     return $pf;
 }
Exemple #2
0
$chan = new PEAR2\SimpleChannelServer\Channel('pear2.php.net', 'unit test channel');
$scs = new PEAR2\SimpleChannelServer\Main($chan, __DIR__, dirname(__DIR__) . '/PEAR2');
$scs->saveChannel();
$pf = new \Pyrus\PackageFile\v2();
for ($i = 1; $i <= 6; $i++) {
    file_put_contents(__DIR__ . "/glooby{$i}", 'hi');
}
$pf->name = 'P1';
$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->setPackagefile(__DIR__ . '/package.xml');
$save = clone $pf;
$pf->dependencies['required']->package['pear2.php.net/P2']->min('1.1.0')->exclude('1.2.0')->exclude('1.2.3')->recommended('1.3.1')->max('2.0.0');
$pf->files['glooby1'] = array('role' => 'php');
$p2_1 = clone $save;
$p2_1->name = 'P2';
$p2_1->version['release'] = '1.0.0';
$p2_1->stability['release'] = 'stable';
$p2_1->files['glooby2'] = array('role' => 'php');
$p2_2 = clone $save;
$p2_2->name = 'P2';
$p2_2->version['release'] = '1.2.0';
$p2_2->stability['release'] = 'stable';
$p2_2->files['glooby3'] = array('role' => 'php');
$p2_3 = clone $save;
$p2_3->name = 'P2';