Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change namespace from pear2 to PEAR2, as approved by the PEAR Group.

  • Loading branch information...
commit d5106b76537451135e36c196f4a8eca7c7cfea53 1 parent 5cc63a1
@saltybeagle saltybeagle authored
View
12 customcommand/commands.xml
@@ -2,7 +2,7 @@
<commands version="2.0" xmlns="http://pear2.php.net/dtd/customcommand-2.0">
<command>
<name>scs-update</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusUpdate</function>
<autoloadpath/>
<summary>Simple channel server: Update all releases of a within the get/ directory.</summary>
@@ -21,7 +21,7 @@ In addition, the handle configuration variable must be set to your handle
</command>
<command>
<name>scs-create</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusCreate</function>
<autoloadpath/>
<summary>Simple channel server: Create a channel.xml, get/ and rest/ directory for a channel</summary>
@@ -60,7 +60,7 @@ specified by the location of the channel.xml file.
</command>
<command>
<name>scs-add-maintainer</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusAddMaintainer</function>
<autoloadpath/>
<summary>Simple Channel Server: Add a new maintaing developer to the channel</summary>
@@ -93,7 +93,7 @@ to be listed prior to making their first release.
</command>
<command>
<name>scs-add-category</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusAddCategory</function>
<autoloadpath/>
<summary>Simple Channel Server: Add a new category to the channel</summary>
@@ -120,7 +120,7 @@ command to create a new category.
</command>
<command>
<name>scs-categorize</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusCategorize</function>
<autoloadpath/>
<summary>Simple Channel Server: Categorize a package</summary>
@@ -146,7 +146,7 @@ Use this command to add a package to a category.
</command>
<command>
<name>scs-release</name>
- <class>pear2\SimpleChannelServer\CLI</class>
+ <class>PEAR2\SimpleChannelServer\CLI</class>
<function>pyrusRelease</function>
<autoloadpath/>
<summary>Simple Channel Server: Release a package</summary>
View
14 examples/update_channel.php
@@ -21,16 +21,16 @@
var_dump($category);
}
*/
-$channel = new pear2\SimpleChannelServer\Channel('pear2.php.net','Brett Bieber\'s PEAR Channel','salty');
+$channel = new PEAR2\SimpleChannelServer\Channel('pear2.php.net','Brett Bieber\'s PEAR Channel','salty');
-//$scs = new pear2\SimpleChannelServer\Main($channel,'/Library/WebServer/Documents/pearserver','/home/bbieber/pyrus/php');
-$scs = new pear2\SimpleChannelServer\Main($channel,'/home/cellog/testapache/htdocs',\pear2\Pyrus\Config::current()->location);
-$categories = pear2\SimpleChannelServer\Categories::create('Default', 'This is the default category');
+//$scs = new PEAR2\SimpleChannelServer\Main($channel,'/Library/WebServer/Documents/pearserver','/home/bbieber/pyrus/php');
+$scs = new PEAR2\SimpleChannelServer\Main($channel,'/home/cellog/testapache/htdocs',\PEAR2\Pyrus\Config::current()->location);
+$categories = PEAR2\SimpleChannelServer\Categories::create('Default', 'This is the default category');
$scs->saveChannel();
-$scs->saveRelease(new \pear2\Pyrus\Package(dirname(__FILE__) . '/../package.xml'), 'cellog');
+$scs->saveRelease(new \PEAR2\Pyrus\Package(dirname(__FILE__) . '/../package.xml'), 'cellog');
echo 'did it'.PHP_EOL;
/*
-$manager = new pear2\SimpleChannelServer\REST_Manager('/Library/WebServer/Documents/pearserver','pear2.php.net','rest/',array('cellog'));
-var_dump($manager->saveRelease(new \pear2\Pyrus\Package(dirname(__FILE__) . '/../package.xml'),'cellog'));
+$manager = new PEAR2\SimpleChannelServer\REST_Manager('/Library/WebServer/Documents/pearserver','pear2.php.net','rest/',array('cellog'));
+var_dump($manager->saveRelease(new \PEAR2\Pyrus\Package(dirname(__FILE__) . '/../package.xml'),'cellog'));
*/
?>
View
2  examples/upgradeFromChiara.php
@@ -25,7 +25,7 @@
$dir = new DirectoryIterator($dirname);
foreach ($dir as $file) {
if (!$file->isDot() && substr($file->getFilename(), -3) != 'tar') {
- $scs->saveRelease(new \pear2\Pyrus\Package($dirname.$file->getFilename()), 'saltybeagle');
+ $scs->saveRelease(new \PEAR2\Pyrus\Package($dirname.$file->getFilename()), 'saltybeagle');
}
}
View
12 extrasetup.php
@@ -1,12 +1,12 @@
<?php
-$pyrus = new \pear2\Pyrus\Package(__DIR__ . '/../../Pyrus/package.xml');
-$pyrus->setPackagingFilter('pear2\Pyrus\PackageFile\v2Iterator\MinimalPackageFilter');
+$pyrus = new \PEAR2\Pyrus\Package(__DIR__ . '/../../Pyrus/package.xml');
+$pyrus->setPackagingFilter('PEAR2\Pyrus\PackageFile\v2Iterator\MinimalPackageFilter');
$extrafiles = array(
- new \pear2\Pyrus\Package(__DIR__ . '/../../HTTP_Request/package.xml'),
+ new \PEAR2\Pyrus\Package(__DIR__ . '/../../HTTP_Request/package.xml'),
$pyrus,
- new \pear2\Pyrus\Package(__DIR__ . '/../../Pyrus_Developer/package.xml'),
- new \pear2\Pyrus\Package(__DIR__ . '/../../Exception/package.xml'),
- new \pear2\Pyrus\Package(__DIR__ . '/../../MultiErrors/package.xml'),
+ new \PEAR2\Pyrus\Package(__DIR__ . '/../../Pyrus_Developer/package.xml'),
+ new \PEAR2\Pyrus\Package(__DIR__ . '/../../Exception/package.xml'),
+ new \PEAR2\Pyrus\Package(__DIR__ . '/../../MultiErrors/package.xml'),
);
?>
View
24 makepackage.php
@@ -3,20 +3,20 @@
ini_set('display_errors',true);
require_once dirname(__FILE__).'/../../autoload.php';
-$a = new \pear2\Pyrus\Developer\PackageFile\PEAR2SVN(dirname(__FILE__), 'PEAR2_SimpleChannelServer');
+$a = new \PEAR2\Pyrus\Developer\PackageFile\PEAR2SVN(dirname(__FILE__), 'PEAR2_SimpleChannelServer');
-$package = new \pear2\Pyrus\Package('package.xml');
+$package = new \PEAR2\Pyrus\Package('package.xml');
$outfile = $package->name.'-'.$package->version['release'];
-$a = new \pear2\Pyrus\Package\Creator(array(
- //new \pear2\Pyrus\Developer\Creator\Tar($outfile.'.tar', 'none'),
- new \pear2\Pyrus\Developer\Creator\Phar($outfile.'.tgz', false, Phar::TAR, Phar::GZ),),
+$a = new \PEAR2\Pyrus\Package\Creator(array(
+ //new \PEAR2\Pyrus\Developer\Creator\Tar($outfile.'.tar', 'none'),
+ new \PEAR2\Pyrus\Developer\Creator\Phar($outfile.'.tgz', false, Phar::TAR, Phar::GZ),),
dirname(__FILE__).'/../../Exception/src',
dirname(__FILE__).'/../../Autoload/src',
dirname(__FILE__).'/../../MultiErrors/src');
$a->render($package);
-$a = new \pear2\Pyrus\Package\Creator(array(
- new \pear2\Pyrus\Developer\Creator\Phar(__DIR__ . '/pearscs.phar', '<?php
+$a = new \PEAR2\Pyrus\Package\Creator(array(
+ new \PEAR2\Pyrus\Developer\Creator\Phar(__DIR__ . '/pearscs.phar', '<?php
function __autoload($class)
{
include \'phar://\' . PYRUS_PHAR_FILE . \'/PEAR2_SimpleChannelServer-' .
@@ -24,13 +24,13 @@ function __autoload($class)
}
set_include_path(\'phar://\' . PYRUS_PHAR_FILE . \'/PEAR2_SimpleChannelServer-' .
$package->version['release'] . '/php/\'.PATH_SEPARATOR.get_include_path());
-$cli = new \pear2\SimpleChannelServer\CLI();
+$cli = new \PEAR2\SimpleChannelServer\CLI();
$cli->process();
'),),
dirname(__FILE__) . '/../../Exception/src',
dirname(__FILE__) . '/../../Autoload/src',
dirname(__FILE__) . '/../../MultiErrors/src');
-$b = new \pear2\Pyrus\Package(__DIR__ . '/package.xml');
+$b = new \PEAR2\Pyrus\Package(__DIR__ . '/package.xml');
$rp = __DIR__ . '/../../HTTP_Request/src/HTTP';
$additional_files = array(
@@ -43,9 +43,9 @@ function __autoload($class)
'php/PEAR2/HTTP/Request/Response.php' => $rp . '/Request/Response.php',
'php/PEAR2/HTTP/Request/Uri.php' => $rp . '/Request/Uri.php',
);
-$pyrus = new \pear2\Pyrus\Package(__DIR__ . '/../../Pyrus/package.xml');
-$pyrus_developer = new \pear2\Pyrus\Package(__DIR__ . '/../../Pyrus_Developer/package.xml');
-$exception = new \pear2\Pyrus\Package(__DIR__ . '/../../Exception/package.xml');
+$pyrus = new \PEAR2\Pyrus\Package(__DIR__ . '/../../Pyrus/package.xml');
+$pyrus_developer = new \PEAR2\Pyrus\Package(__DIR__ . '/../../Pyrus_Developer/package.xml');
+$exception = new \PEAR2\Pyrus\Package(__DIR__ . '/../../Exception/package.xml');
foreach (array('Pyrus' => $pyrus,
'Pyrus_Developer' => $pyrus_developer,
'Exception' => $exception) as $add_dir=>$add_package) {
View
6 package.xml
@@ -27,8 +27,8 @@ More information here: http://pear.php.net/manual/en/channels.scs.php
<email>brett.bieber@gmail.com</email>
<active>yes</active>
</lead>
- <date>2009-12-19</date>
- <time>16:28:03</time>
+ <date>2010-04-01</date>
+ <time>10:17:41</time>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
@@ -52,7 +52,7 @@ More information here: http://pear.php.net/manual/en/channels.scs.php
<dir name="scripts" baseinstalldir="/">
<file role="script" name="pearscs"/>
</dir>
- <dir name="src" baseinstalldir="pear2">
+ <dir name="src" baseinstalldir="PEAR2">
<dir name="SimpleChannelServer">
<dir name="Categories">
<file role="php" name="Exception.php"/>
View
52 package_compatible.xml
@@ -27,8 +27,8 @@ More information here: http://pear.php.net/manual/en/channels.scs.php
<email>brett.bieber@gmail.com</email>
<active>yes</active>
</lead>
- <date>2009-12-19</date>
- <time>16:28:03</time>
+ <date>2010-04-01</date>
+ <time>10:17:41</time>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
@@ -43,18 +43,18 @@ More information here: http://pear.php.net/manual/en/channels.scs.php
<contents>
<dir name="/">
<file role="script" name="script/pearscs"/>
- <file role="php" name="php/pear2/SimpleChannelServer/REST/Release.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/REST/Package.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/REST/Manager.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/REST/Maintainer.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/REST/Category.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Main.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Get.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Exception.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/CLI.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Channel.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Categories/Exception.php"/>
- <file role="php" name="php/pear2/SimpleChannelServer/Categories.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/REST/Release.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/REST/Package.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/REST/Manager.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/REST/Maintainer.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/REST/Category.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Main.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Get.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Exception.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/CLI.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Channel.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Categories/Exception.php"/>
+ <file role="php" name="php/PEAR2/SimpleChannelServer/Categories.php"/>
<file role="doc" name="doc/PEAR2_SimpleChannelServer/pear2.php.net/examples/examples/upgradeFromChiara.php"/>
<file role="doc" name="doc/PEAR2_SimpleChannelServer/pear2.php.net/examples/examples/update_channel.php"/>
<file role="data" name="customcommand/PEAR2_SimpleChannelServer/pear2.php.net/commands.xml"/>
@@ -83,18 +83,18 @@ More information here: http://pear.php.net/manual/en/channels.scs.php
<install name="customcommand/PEAR2_SimpleChannelServer/pear2.php.net/commands.xml" as="pear2.php.net/commands.xml"/>
<install name="doc/PEAR2_SimpleChannelServer/pear2.php.net/examples/examples/update_channel.php" as="pear2.php.net/examples/examples/update_channel.php"/>
<install name="doc/PEAR2_SimpleChannelServer/pear2.php.net/examples/examples/upgradeFromChiara.php" as="pear2.php.net/examples/examples/upgradeFromChiara.php"/>
- <install name="php/pear2/SimpleChannelServer/Categories.php" as="pear2/SimpleChannelServer/Categories.php"/>
- <install name="php/pear2/SimpleChannelServer/Categories/Exception.php" as="pear2/SimpleChannelServer/Categories/Exception.php"/>
- <install name="php/pear2/SimpleChannelServer/Channel.php" as="pear2/SimpleChannelServer/Channel.php"/>
- <install name="php/pear2/SimpleChannelServer/CLI.php" as="pear2/SimpleChannelServer/CLI.php"/>
- <install name="php/pear2/SimpleChannelServer/Exception.php" as="pear2/SimpleChannelServer/Exception.php"/>
- <install name="php/pear2/SimpleChannelServer/Get.php" as="pear2/SimpleChannelServer/Get.php"/>
- <install name="php/pear2/SimpleChannelServer/Main.php" as="pear2/SimpleChannelServer/Main.php"/>
- <install name="php/pear2/SimpleChannelServer/REST/Category.php" as="pear2/SimpleChannelServer/REST/Category.php"/>
- <install name="php/pear2/SimpleChannelServer/REST/Maintainer.php" as="pear2/SimpleChannelServer/REST/Maintainer.php"/>
- <install name="php/pear2/SimpleChannelServer/REST/Manager.php" as="pear2/SimpleChannelServer/REST/Manager.php"/>
- <install name="php/pear2/SimpleChannelServer/REST/Package.php" as="pear2/SimpleChannelServer/REST/Package.php"/>
- <install name="php/pear2/SimpleChannelServer/REST/Release.php" as="pear2/SimpleChannelServer/REST/Release.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Categories.php" as="PEAR2/SimpleChannelServer/Categories.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Categories/Exception.php" as="PEAR2/SimpleChannelServer/Categories/Exception.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Channel.php" as="PEAR2/SimpleChannelServer/Channel.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/CLI.php" as="PEAR2/SimpleChannelServer/CLI.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Exception.php" as="PEAR2/SimpleChannelServer/Exception.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Get.php" as="PEAR2/SimpleChannelServer/Get.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/Main.php" as="PEAR2/SimpleChannelServer/Main.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/REST/Category.php" as="PEAR2/SimpleChannelServer/REST/Category.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/REST/Maintainer.php" as="PEAR2/SimpleChannelServer/REST/Maintainer.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/REST/Manager.php" as="PEAR2/SimpleChannelServer/REST/Manager.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/REST/Package.php" as="PEAR2/SimpleChannelServer/REST/Package.php"/>
+ <install name="php/PEAR2/SimpleChannelServer/REST/Release.php" as="PEAR2/SimpleChannelServer/REST/Release.php"/>
<install name="script/pearscs" as="pearscs"/>
</filelist>
</phprelease>
View
2  scripts/pearscs
@@ -8,5 +8,5 @@ if (file_exists(dirname(__FILE__).'/../../../autoload.php')) {
require_once $autoload;
-$cli = new \pear2\SimpleChannelServer\CLI();
+$cli = new \PEAR2\SimpleChannelServer\CLI();
$cli->process();
View
26 src/SimpleChannelServer/CLI.php
@@ -1,11 +1,11 @@
<?php
-namespace pear2\SimpleChannelServer;
+namespace PEAR2\SimpleChannelServer;
class CLI
{
/**
* Channel object
*
- * @var \pear2\Pyrus\Channel
+ * @var \PEAR2\Pyrus\Channel
*/
protected $channel;
@@ -21,7 +21,7 @@ class CLI
/**
* The simplechannelserver object
*
- * @var pear2\SimpleChannelServer\Main
+ * @var PEAR2\SimpleChannelServer\Main
*/
public $scs;
@@ -30,7 +30,7 @@ public function __construct()
$channel_file = getcwd() . '/channel.xml';
$this->dir = getcwd();
if (file_exists($channel_file)) {
- $this->channel = new \pear2\Pyrus\Channel(new \pear2\Pyrus\ChannelFile($channel_file));
+ $this->channel = new \PEAR2\Pyrus\Channel(new \PEAR2\Pyrus\ChannelFile($channel_file));
$this->scs = new Main($this->channel, $this->dir);
}
}
@@ -176,15 +176,15 @@ function pyrusUpdate($frontend, $args)
if (null === $frontend) {
$maintainer = $args;
} else {
- $chan = \pear2\Pyrus\Config::current()->default_channel;
- \pear2\Pyrus\Config::current()->default_channel = $this->channel->name;
- $maintainer = \pear2\Pyrus\Config::current()->handle;
- \pear2\Pyrus\Config::current()->default_channel = $chan;
+ $chan = \PEAR2\Pyrus\Config::current()->default_channel;
+ \PEAR2\Pyrus\Config::current()->default_channel = $this->channel->name;
+ $maintainer = \PEAR2\Pyrus\Config::current()->handle;
+ \PEAR2\Pyrus\Config::current()->default_channel = $chan;
}
$dirname = $this->dir . '/get/';
$dir = new \DirectoryIterator($dirname);
- $errs = new \pear2\MultiErrors;
+ $errs = new \PEAR2\MultiErrors;
foreach ($dir as $file) {
if (!$file->isDot()
&& !$file->isDir()
@@ -217,10 +217,10 @@ public function handleRelease()
function pyrusRelease($frontend, $args)
{
if (null !== $frontend) {
- $chan = \pear2\Pyrus\Config::current()->default_channel;
- \pear2\Pyrus\Config::current()->default_channel = $this->channel->name;
- $args['maintainer'] = \pear2\Pyrus\Config::current()->handle;
- \pear2\Pyrus\Config::current()->default_channel = $chan;
+ $chan = \PEAR2\Pyrus\Config::current()->default_channel;
+ \PEAR2\Pyrus\Config::current()->default_channel = $this->channel->name;
+ $args['maintainer'] = \PEAR2\Pyrus\Config::current()->handle;
+ \PEAR2\Pyrus\Config::current()->default_channel = $chan;
}
$this->scs->saveRelease($args['path'], $args['maintainer']);
echo 'Release successfully saved.'.PHP_EOL;
View
12 src/SimpleChannelServer/Categories.php
@@ -13,7 +13,7 @@
* create('Name4', 'Description 4');
* file_put_contents('/path/to/serialize/categories.inf', serialize($cat));
* }
- * $categories = pear2\SimpleChannelServer\Categories::getCategories();
+ * $categories = PEAR2\SimpleChannelServer\Categories::getCategories();
* $categories->link('SimpleChannelServer', 'Developer');
* </code>
*
@@ -23,7 +23,7 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer;
+namespace PEAR2\SimpleChannelServer;
class Categories
{
/**
@@ -37,7 +37,7 @@ class Categories
protected $channel;
- public function __construct(\pear2\Pyrus\Channel $channel)
+ public function __construct(\PEAR2\Pyrus\Channel $channel)
{
$this->channel = $channel;
$rest = preg_replace('/https?:\/\/' . str_replace('/','\/', $channel->name) . '/',
@@ -54,7 +54,7 @@ public function __construct(\pear2\Pyrus\Channel $channel)
if (!$fileinfo->isDot()
&& $fileinfo->isDir()
&& substr($fileinfo->getFilename(), 0, 1) != '.') {
- $parser = new \pear2\Pyrus\XMLParser;
+ $parser = new \PEAR2\Pyrus\XMLParser;
try {
$content = file_get_contents($fileinfo->getPathname().'/info.xml');
$content = $parser->parseString($content);
@@ -83,7 +83,7 @@ public function exists($category)
* @param string $description Description of the category
* @param string $alias Alias of the category
*
- * @return pear2\SimpleChannelServer\Categories
+ * @return PEAR2\SimpleChannelServer\Categories
*/
public function create($name, $description, $alias = null)
{
@@ -162,7 +162,7 @@ public function packagesInCategory($category)
$packages = array();
$file = $this->_restDir.'c/'.urlencode($category).'/packages.xml';
if (file_exists($file)) {
- $parser = new \pear2\Pyrus\XMLParser;
+ $parser = new \PEAR2\Pyrus\XMLParser;
try {
$content = file_get_contents($file);
$content = $parser->parseString($content);
View
2  src/SimpleChannelServer/Categories/Exception.php
@@ -1,3 +1,3 @@
<?php
-namespace pear2\SimpleChannelServer\Categories;
+namespace PEAR2\SimpleChannelServer\Categories;
class Exception extends \Exception {}
View
4 src/SimpleChannelServer/Channel.php
@@ -8,8 +8,8 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer;
-class Channel extends \pear2\Pyrus\ChannelFile
+namespace PEAR2\SimpleChannelServer;
+class Channel extends \PEAR2\Pyrus\ChannelFile
{
function __construct($name, $summary, $suggestedalias = null, $restpath = 'rest/')
View
2  src/SimpleChannelServer/Exception.php
@@ -1,3 +1,3 @@
<?php
-namespace pear2\SimpleChannelServer;
+namespace PEAR2\SimpleChannelServer;
class Exception extends \Exception {}
View
6 src/SimpleChannelServer/Get.php
@@ -1,5 +1,5 @@
<?php
-namespace pear2\SimpleChannelServer;
+namespace PEAR2\SimpleChannelServer;
class Get
{
protected $get;
@@ -21,7 +21,7 @@ function __construct($savepath, $pyruspath)
function saveRelease($new, $releaser)
{
$parts = pathinfo($new);
- $cloner = new \pear2\Pyrus\Package\Cloner($new, $this->get);
+ $cloner = new \PEAR2\Pyrus\Package\Cloner($new, $this->get);
if (!file_exists($this->get.$parts['filename'].'.tar')) {
$cloner->toTar();
}
@@ -37,7 +37,7 @@ function saveRelease($new, $releaser)
return true;
}
- function deleteRelease(\pear2\Pyrus\Package $release)
+ function deleteRelease(\PEAR2\Pyrus\Package $release)
{
}
View
14 src/SimpleChannelServer/Main.php
@@ -8,7 +8,7 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer;
+namespace PEAR2\SimpleChannelServer;
class Main
{
/**
@@ -32,21 +32,21 @@ class Main
/**
* REST manager
*
- * @var pear2\SimpleChannelServer\REST\Manager
+ * @var PEAR2\SimpleChannelServer\REST\Manager
*/
protected $rest;
/**
* GET manager
*
- * @var pear2\SimpleChannelServer\Get
+ * @var PEAR2\SimpleChannelServer\Get
*/
protected $get;
/**
* Construct simple channel server
*
- * @param pear2\SimpleChannelServer\Channel $channel channel object
+ * @param PEAR2\SimpleChannelServer\Channel $channel channel object
* @param string $webpath full path to web files eg: /var/www/pear/
* @param string $pyruspath Path to the pyrus controlled PEAR installation
*/
@@ -78,7 +78,7 @@ function __construct($channel, $webpath, $pyruspath = null)
$restpath);
$this->get = new Get($webpath.'/get', $pyruspath);
try {
- $a = \pear2\Pyrus\Config::singleton($pyruspath);
+ $a = \PEAR2\Pyrus\Config::singleton($pyruspath);
} catch (Exception $e) {
throw new Exception('Cannot initialize Pyrus Config',
$e);
@@ -99,7 +99,7 @@ function categorize($package, $category)
function saveRelease($package, $releaser)
{
- $rest = $this->rest->saveRelease(new \pear2\Pyrus\Package($package), $releaser);
+ $rest = $this->rest->saveRelease(new \PEAR2\Pyrus\Package($package), $releaser);
$get = $this->get->saveRelease($package, $releaser);
return $rest && $get;
}
@@ -197,7 +197,7 @@ function listMaintainers($package = null)
$e);
}
}
- $reader = new \pear2\Pyrus\XMLParser;
+ $reader = new \PEAR2\Pyrus\XMLParser;
$path = $this->rest->getRESTPath('r', strtolower($package) . '/maintainers2.xml');
if (!file_exists($path)) {
return array();
View
14 src/SimpleChannelServer/REST/Category.php
@@ -8,8 +8,8 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer\REST;
-use pear2\SimpleChannelServer\Categories;
+namespace PEAR2\SimpleChannelServer\REST;
+use PEAR2\SimpleChannelServer\Categories;
class Category extends Manager
{
protected $_categories;
@@ -30,11 +30,11 @@ function __construct($savepath, $channel, $serverpath = 'rest/', Categories $cat
/**
* Save a package release's REST-related information
*
- * @param \pear2\Pyrus\Package $new Package to save category for
+ * @param \PEAR2\Pyrus\Package $new Package to save category for
*
* @return void
*/
- function save(\pear2\Pyrus\Package $new)
+ function save(\PEAR2\Pyrus\Package $new)
{
$category = $this->_categories->getPackageCategory($new->name);
$this->savePackages($category);
@@ -45,11 +45,11 @@ function save(\pear2\Pyrus\Package $new)
/**
* Delete a package release's REST-related information
*
- * @param \pear2\Pyrus\Package $new Package to rease rest info for
+ * @param \PEAR2\Pyrus\Package $new Package to rease rest info for
*
* @return void
*/
- function erase(\pear2\Pyrus\Package $new)
+ function erase(\PEAR2\Pyrus\Package $new)
{
$category = $this->_categories->getPackageCategory($new->name);
$this->savePackagesInfo($category);
@@ -138,7 +138,7 @@ function savePackagesInfo($category)
$pdir = $this->rest . DIRECTORY_SEPARATOR . 'p';
$rdir = $this->rest . DIRECTORY_SEPARATOR . 'r';
$packages = $this->_categories->packagesInCategory($category);
- $reader = new \pear2\Pyrus\XMLParser;
+ $reader = new \PEAR2\Pyrus\XMLParser;
clearstatcache();
$xml['pi'] = array();
foreach ($packages as $package) {
View
8 src/SimpleChannelServer/REST/Maintainer.php
@@ -8,11 +8,11 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer\REST;
-use pear2\SimpleChannelServer\Exception;
+namespace PEAR2\SimpleChannelServer\REST;
+use PEAR2\SimpleChannelServer\Exception;
class Maintainer extends Manager
{
- function save(\pear2\Pyrus\Package $new)
+ function save(\PEAR2\Pyrus\Package $new)
{
foreach ($new->allmaintainers as $role => $maintainers) {
foreach ($maintainers as $dev) {
@@ -50,7 +50,7 @@ function saveInfo($handle, $name, $uri = false)
function getInfo($handle)
{
$path = $this->getRESTPath('m', strtolower($handle) . '/info.xml');
- $reader = new \pear2\Pyrus\XMLParser;
+ $reader = new \PEAR2\Pyrus\XMLParser;
if (!file_exists($path)) {
return false;
}
View
16 src/SimpleChannelServer/REST/Manager.php
@@ -8,8 +8,8 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer\REST;
-use pear2\SimpleChannelServer\Exception;
+namespace PEAR2\SimpleChannelServer\REST;
+use PEAR2\SimpleChannelServer\Exception;
class Manager
{
/**
@@ -53,10 +53,10 @@ function __construct($savepath, $channel, $serverpath = 'rest/')
/**
* Save release REST for a new package release.
*
- * @param \pear2\Pyrus\Package $release
+ * @param \PEAR2\Pyrus\Package $release
* @param string $releaser handle of person who is uploading this release
*/
- function saveRelease(\pear2\Pyrus\Package $new, $releaser)
+ function saveRelease(\PEAR2\Pyrus\Package $new, $releaser)
{
if ($new->channel !== $this->chan) {
throw new Exception('Cannot release ' .
@@ -64,7 +64,7 @@ function saveRelease(\pear2\Pyrus\Package $new, $releaser)
$this->chan . ' channel, and package is in ' .
$new->channel . ' channel');
}
- $categories = new \pear2\SimpleChannelServer\Categories($this->channel);
+ $categories = new \PEAR2\SimpleChannelServer\Categories($this->channel);
$category = new Category($this->rest, $this->channel,
$this->uri, $categories);
$package = new Package($this->rest, $this->channel,
@@ -85,11 +85,11 @@ function saveRelease(\pear2\Pyrus\Package $new, $releaser)
* Removes REST. If $deleteorphaned is true, then
* maintainers who no longer maintain a package will be
* deleted from package maintainer REST.
- * @param \pear2\Pyrus\Package $release
+ * @param \PEAR2\Pyrus\Package $release
* @param string $deleter handle of maintainer deleting this release
* @param bool $deleteorphaned
*/
- function deleteRelease(\pear2\Pyrus\Package $release, $deleter, $deleteorphaned = true)
+ function deleteRelease(\PEAR2\Pyrus\Package $release, $deleter, $deleteorphaned = true)
{
if ($new->channel !== $this->chan) {
throw new Exception('Cannot delete release ' .
@@ -175,7 +175,7 @@ private function _saveREST($path, $contents, $isxml, $type)
{
$this->_initDir($this->rest . '/' . $type . '/' . $path);
if ($isxml) {
- $contents = (string) new \pear2\Pyrus\XMLWriter($contents);
+ $contents = (string) new \PEAR2\Pyrus\XMLWriter($contents);
}
file_put_contents($this->rest . '/' . $type . '/' . $path, $contents);
chmod($this->rest . '/' . $type . '/' . $path, 0666);
View
22 src/SimpleChannelServer/REST/Package.php
@@ -11,8 +11,8 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer\REST;
-use pear2\SimpleChannelServer\Categories;
+namespace PEAR2\SimpleChannelServer\REST;
+use PEAR2\SimpleChannelServer\Categories;
class Package extends Manager
{
private $_packages = array();
@@ -20,9 +20,9 @@ class Package extends Manager
/**
* Save package REST based on a release
*
- * @param \pear2\Pyrus\package $new
+ * @param \PEAR2\Pyrus\package $new
*/
- function save(\pear2\Pyrus\Package $new)
+ function save(\PEAR2\Pyrus\Package $new)
{
$this->_packages[$new->name] = true;
$this->saveInfo($new);
@@ -34,9 +34,9 @@ function save(\pear2\Pyrus\Package $new)
* Remove package REST based on a release
*
* This does nothing
- * @param \pear2\Pyrus\package $new
+ * @param \PEAR2\Pyrus\package $new
*/
- function erase(\pear2\Pyrus\Package $new)
+ function erase(\PEAR2\Pyrus\Package $new)
{
}
@@ -76,11 +76,11 @@ function deletePackage($name)
/**
* Save package REST based on a release
*
- * @param \pear2\Pyrus\Package $new
+ * @param \PEAR2\Pyrus\Package $new
*/
- function saveInfo(\pear2\Pyrus\Package $new)
+ function saveInfo(\PEAR2\Pyrus\Package $new)
{
- $reader = new \pear2\Pyrus\XMLParser;
+ $reader = new \PEAR2\Pyrus\XMLParser;
$deprecated = false;
if (file_exists($this->rest . DIRECTORY_SEPARATOR . 'p' . DIRECTORY_SEPARATOR .
'info.xml')) {
@@ -140,11 +140,11 @@ function saveAllPackages()
/**
* Save package maintainers information for this release
*
- * @param \pear2\Pyrus\Package $new package to be saved
+ * @param \PEAR2\Pyrus\Package $new package to be saved
*
* @return void
*/
- function saveMaintainers(\pear2\Pyrus\Package $new)
+ function saveMaintainers(\PEAR2\Pyrus\Package $new)
{
$m = $this->_getProlog('m', 'packagemaintainers');
$m2 = $this->_getProlog('m', 'packagemaintainers2');
View
42 src/SimpleChannelServer/REST/Release.php
@@ -8,19 +8,19 @@
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @link http://svn.php.net/viewvc/pear2/sandbox/SimpleChannelServer/
*/
-namespace pear2\SimpleChannelServer\REST;
-use pear2\SimpleChannelServer\Categories;
+namespace PEAR2\SimpleChannelServer\REST;
+use PEAR2\SimpleChannelServer\Categories;
class Release extends Manager
{
/**
* Save a package release's REST information
*
- * @param \pear2\Pyrus\Package $new new package to be released
+ * @param \PEAR2\Pyrus\Package $new new package to be released
* @param string $releaser handle of the maintainer who released this package
*
* @return void
*/
- function save(\pear2\Pyrus\Package $new, $releaser)
+ function save(\PEAR2\Pyrus\Package $new, $releaser)
{
$this->saveInfo($new, $releaser);
$this->saveInfo2($new, $releaser);
@@ -34,11 +34,11 @@ function save(\pear2\Pyrus\Package $new, $releaser)
/**
* Delete a release from REST information
*
- * @param \pear2\Pyrus\Package $new Package to be erased
+ * @param \PEAR2\Pyrus\Package $new Package to be erased
*
* @return void
*/
- function erase(\pear2\Pyrus\Package $new)
+ function erase(\PEAR2\Pyrus\Package $new)
{
$this->saveAll($new, true);
$xml = $this->saveAll2($new, true);
@@ -73,12 +73,12 @@ function erase(\pear2\Pyrus\Package $new)
/**
* save rest.release release REST
*
- * @param \pear2\Pyrus\Package $new package to save info for
+ * @param \PEAR2\Pyrus\Package $new package to save info for
* @param string $releaser releasing maintainer's handle
*
* @return void
*/
- function saveInfo(\pear2\Pyrus\Package $new, $releaser)
+ function saveInfo(\PEAR2\Pyrus\Package $new, $releaser)
{
$xml = $this->_getProlog('r', 'release');
$xml['r']['p'] = array(
@@ -111,12 +111,12 @@ function saveInfo(\pear2\Pyrus\Package $new, $releaser)
/**
* save rest.release2 release REST
*
- * @param \pear2\Pyrus\Package $new package to be saved
+ * @param \PEAR2\Pyrus\Package $new package to be saved
* @param string $releaser releasing maintainer's handle
*
* @return void
*/
- function saveInfo2(\pear2\Pyrus\Package $new, $releaser)
+ function saveInfo2(\PEAR2\Pyrus\Package $new, $releaser)
{
$xml = $this->_getProlog('r', 'release2');
$xml['r']['p'] = array(
@@ -151,11 +151,11 @@ function saveInfo2(\pear2\Pyrus\Package $new, $releaser)
/**
* Save a release's package.xml contents
*
- * @param \pear2\Pyrus\Package $new package to be saved
+ * @param \PEAR2\Pyrus\Package $new package to be saved
*
* @return void
*/
- function savePackageXml(\pear2\Pyrus\Package $new)
+ function savePackageXml(\PEAR2\Pyrus\Package $new)
{
$this->saveReleaseREST(strtolower($new->name) . '/package.' .
$new->version['release'] . '.xml', file_get_contents($new->packagefile),
@@ -165,11 +165,11 @@ function savePackageXml(\pear2\Pyrus\Package $new)
/**
* Save a serialized representation of a package's dependencies
*
- * @param \pear2\Pyrus\Package $new package to be saved
+ * @param \PEAR2\Pyrus\Package $new package to be saved
*
* @return void
*/
- function savePackageDeps(\pear2\Pyrus\Package $new)
+ function savePackageDeps(\PEAR2\Pyrus\Package $new)
{
$this->saveReleaseREST(strtolower($new->name) . '/deps.' .
$new->version['release'] . '.txt', serialize($new->rawdeps),
@@ -179,20 +179,20 @@ function savePackageDeps(\pear2\Pyrus\Package $new)
/**
* save REST information for all releases of this package
*
- * @param \pear2\Pyrus\Package $new package to save all release info for
+ * @param \PEAR2\Pyrus\Package $new package to save all release info for
* @param bool $erase if true, the release represented by the
* version of $new will be removed.
*
* @return void
*/
- function saveAll(\pear2\Pyrus\Package $new, $erase = false, $is2 = false)
+ function saveAll(\PEAR2\Pyrus\Package $new, $erase = false, $is2 = false)
{
if ($is2) {
$is2 = '2';
} else {
$is2 = '';
}
- $reader = new \pear2\Pyrus\XMLParser;
+ $reader = new \PEAR2\Pyrus\XMLParser;
$path = $this->getRESTPath('r', strtolower($new->name) .
DIRECTORY_SEPARATOR . 'allreleases' . $is2 . '.xml');
if (file_exists($path)) {
@@ -293,13 +293,13 @@ function saveAll(\pear2\Pyrus\Package $new, $erase = false, $is2 = false)
/**
* save REST information for all releases (version 2) of this package
*
- * @param \pear2\Pyrus\Package $new package to save all releases for
+ * @param \PEAR2\Pyrus\Package $new package to save all releases for
* @param bool $erase if true, the release represented by the
* version of $new will be removed.
*
* @return void
*/
- function saveAll2(\pear2\Pyrus\Package $new, $erase = false)
+ function saveAll2(\PEAR2\Pyrus\Package $new, $erase = false)
{
return $this->saveAll($new, $erase, true);
}
@@ -307,11 +307,11 @@ function saveAll2(\pear2\Pyrus\Package $new, $erase = false)
/**
* save REST stability version info in .txt files
*
- * @param \pear2\Pyrus\Package $new package to save stability for
+ * @param \PEAR2\Pyrus\Package $new package to save stability for
*
* @return void
*/
- function saveStability(\pear2\Pyrus\Package $new)
+ function saveStability(\PEAR2\Pyrus\Package $new)
{
$this->saveReleaseREST(strtolower($new->name) . '/latest.txt',
$new->version['release'], false);
View
2  stub.php
@@ -22,6 +22,6 @@ function pyrus_autoload($class)
}
}
spl_autoload_register("pyrus_autoload");
-$cli = new \pear2\SimpleChannelServer\CLI();
+$cli = new \PEAR2\SimpleChannelServer\CLI();
$cli->process();
__HALT_COMPILER();
Please sign in to comment.
Something went wrong with that request. Please try again.