Skip to content

Commit

Permalink
Change namespace from pear2 to PEAR2, as approved by the PEAR Group.
Browse files Browse the repository at this point in the history
  • Loading branch information
saltybeagle committed May 12, 2010
1 parent 63926bd commit c25ba22
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -6,7 +6,7 @@ development and low-volume web sites using PEAR2 packages.
To use:

<?php
require '/path/to/pear2/Autoload.php';
require '/path/to/PEAR2/Autoload.php';
// now use class names from installed PEAR2
// packages at will
?>
8 changes: 4 additions & 4 deletions package.xml
Expand Up @@ -11,7 +11,7 @@ development and low-volume web sites using PEAR2 packages.
To use:

&lt;?php
require '/path/to/pear2/Autoload.php';
require '/path/to/PEAR2/Autoload.php';
// now use class names from installed PEAR2
// packages at will
?&gt;</description>
Expand All @@ -27,8 +27,8 @@ require '/path/to/pear2/Autoload.php';
<email>saltybeagle@php.net</email>
<active>yes</active>
</lead>
<date>2010-03-16</date>
<time>14:27:37</time>
<date>2010-05-11</date>
<time>21:31:21</time>
<version>
<release>0.1.1</release>
<api>0.1.0</api>
Expand All @@ -43,7 +43,7 @@ This will help during the transition from pear2 to PEAR2.
</notes>
<contents>
<dir name="/">
<dir name="src" baseinstalldir="pear2">
<dir name="src" baseinstalldir="PEAR2">
<file role="php" name="Autoload.php"/>
</dir>
</dir>
Expand Down
10 changes: 5 additions & 5 deletions package_compatible.xml
Expand Up @@ -11,7 +11,7 @@ development and low-volume web sites using PEAR2 packages.
To use:

&lt;?php
require '/path/to/pear2/Autoload.php';
require '/path/to/PEAR2/Autoload.php';
// now use class names from installed PEAR2
// packages at will
?&gt;</description>
Expand All @@ -27,8 +27,8 @@ require '/path/to/pear2/Autoload.php';
<email>saltybeagle@php.net</email>
<active>yes</active>
</lead>
<date>2010-03-16</date>
<time>14:27:37</time>
<date>2010-05-11</date>
<time>21:31:21</time>
<version>
<release>0.1.1</release>
<api>0.1.0</api>
Expand All @@ -43,7 +43,7 @@ This will help during the transition from pear2 to PEAR2.
</notes>
<contents>
<dir name="/">
<file role="php" name="php/pear2/Autoload.php"/>
<file role="php" name="php/PEAR2/Autoload.php"/>
</dir>
</contents>
<dependencies>
Expand All @@ -58,7 +58,7 @@ This will help during the transition from pear2 to PEAR2.
</dependencies>
<phprelease>
<filelist>
<install name="php/pear2/Autoload.php" as="pear2/Autoload.php"/>
<install name="php/PEAR2/Autoload.php" as="PEAR2/Autoload.php"/>
</filelist>
</phprelease>
</package>
8 changes: 4 additions & 4 deletions src/Autoload.php
@@ -1,6 +1,6 @@
<?php
namespace pear2;
if (!class_exists('\pear2\Autoload', false)) {
namespace PEAR2;
if (!class_exists('\PEAR2\Autoload', false)) {
class Autoload
{
/**
Expand Down Expand Up @@ -40,7 +40,7 @@ protected static function register()
if (!self::$registered) {
// set up __autoload
$autoload = spl_autoload_functions();
spl_autoload_register('pear2\Autoload::load');
spl_autoload_register('PEAR2\Autoload::load');
if (function_exists('__autoload') && ($autoload === false)) {
// __autoload() was being used, but now would be ignored, add
// it to the autoload stack
Expand Down Expand Up @@ -77,7 +77,7 @@ protected static function addPath($path)
*/
static function load($class)
{
if (strtolower(substr($class, 0, 6)) !== 'pear2\\') {
if (strtolower(substr($class, 0, 6)) !== 'PEAR2\\') {
return false;
}
$file = str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class) . '.php';
Expand Down

0 comments on commit c25ba22

Please sign in to comment.