Permalink
Browse files

modified autoloader so its inside \PAMI\Autoloader, and the class nam…

…e is now \PAMI\Autoloader\Autoloader to honor namespace to filesystem convention, check the README.Autoloader file
  • Loading branch information...
1 parent c4d1b48 commit ae8a2510f0f6fd7f644d8bc9ebabf81560d66206 @marcelog committed May 10, 2011
View
@@ -0,0 +1,8 @@
+NOTE
+----
+PAMI's autoloader has been renamed to the namespace PAMI\Autoloader and the
+class name is now \PAMI\Autoloader\Autoloader so we now honor namespace to
+filesystem convention for classes. Thus, change your code to:
+
+require_once 'PAMI/Autoloader/Autoloader.php'; // Include pami autoloader.
+\PAMI\Autoloader\Autoloader::register(); // Call autoloader register for pami autoloader.
@@ -46,8 +46,8 @@
////////////////////////////////////////////////////////////////////////////////
// Mandatory stuff to bootstrap.
////////////////////////////////////////////////////////////////////////////////
-require_once 'PAMI/Autoloader/PAMI_Autoloader.php'; // Include PAMI autoloader.
-PAMI_Autoloader::register(); // Call autoloader register for PAMI autoloader.
+require_once 'PAMI/Autoloader/Autoloader.php'; // Include PAMI autoloader.
+\PAMI\Autoloader\Autoloader::register(); // Call autoloader register for PAMI autoloader.
use PAMI\Client\Impl\ClientImpl;
use PAMI\Listener\IEventListener;
use PAMI\Message\Event\EventMessage;
@@ -52,8 +52,8 @@
////////////////////////////////////////////////////////////////////////////////
// Mandatory stuff to bootstrap.
////////////////////////////////////////////////////////////////////////////////
-require_once 'PAMI/Autoloader/PAMI_Autoloader.php'; // Include PAMI autoloader.
-PAMI_Autoloader::register(); // Call autoloader register for PAMI autoloader.
+require_once 'PAMI/Autoloader/Autoloader.php'; // Include PAMI autoloader.
+\PAMI\Autoloader\Autoloader::register(); // Call autoloader register for PAMI autoloader.
use PAMI\Client\Impl\ClientImpl;
use PAMI\Listener\IEventListener;
use PAMI\Message\Event\EventMessage;
@@ -26,6 +26,7 @@
* limitations under the License.
*
*/
+namespace PAMI\Autoloader;
foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) {
$truePath = implode(
DIRECTORY_SEPARATOR,
@@ -55,7 +56,7 @@
* @license http://www.noneyet.ar/ Apache License 2.0
* @link http://www.noneyet.ar/
*/
-class PAMI_Autoloader
+class Autoloader
{
/**
* Holds current realpath.
@@ -100,6 +101,6 @@ public static function register()
DIRECTORY_SEPARATOR,
array(realpath(dirname(__FILE__)), '..', '..')
);
- return spl_autoload_register('PAMI_Autoloader::load');
+ return spl_autoload_register('\PAMI\Autoloader\Autoloader::load');
}
}

0 comments on commit ae8a251

Please sign in to comment.