Skip to content

Commit

Permalink
modified autoloader so its inside \PAMI\Autoloader, and the class nam…
Browse files Browse the repository at this point in the history
…e is now \PAMI\Autoloader\Autoloader to honor namespace to filesystem convention, check the README.Autoloader file
  • Loading branch information
marcelog committed May 10, 2011
1 parent c4d1b48 commit ae8a251
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.Autoloader
Original file line number Original file line Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions docs/examples/quickstart/example.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Mandatory stuff to bootstrap. // Mandatory stuff to bootstrap.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require_once 'PAMI/Autoloader/PAMI_Autoloader.php'; // Include PAMI autoloader. require_once 'PAMI/Autoloader/Autoloader.php'; // Include PAMI autoloader.
PAMI_Autoloader::register(); // Call autoloader register for PAMI autoloader. \PAMI\Autoloader\Autoloader::register(); // Call autoloader register for PAMI autoloader.
use PAMI\Client\Impl\ClientImpl; use PAMI\Client\Impl\ClientImpl;
use PAMI\Listener\IEventListener; use PAMI\Listener\IEventListener;
use PAMI\Message\Event\EventMessage; use PAMI\Message\Event\EventMessage;
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/sms/example.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Mandatory stuff to bootstrap. // Mandatory stuff to bootstrap.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
require_once 'PAMI/Autoloader/PAMI_Autoloader.php'; // Include PAMI autoloader. require_once 'PAMI/Autoloader/Autoloader.php'; // Include PAMI autoloader.
PAMI_Autoloader::register(); // Call autoloader register for PAMI autoloader. \PAMI\Autoloader\Autoloader::register(); // Call autoloader register for PAMI autoloader.
use PAMI\Client\Impl\ClientImpl; use PAMI\Client\Impl\ClientImpl;
use PAMI\Listener\IEventListener; use PAMI\Listener\IEventListener;
use PAMI\Message\Event\EventMessage; use PAMI\Message\Event\EventMessage;
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
namespace PAMI\Autoloader;
foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) { foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) {
$truePath = implode( $truePath = implode(
DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,
Expand Down Expand Up @@ -55,7 +56,7 @@
* @license http://www.noneyet.ar/ Apache License 2.0 * @license http://www.noneyet.ar/ Apache License 2.0
* @link http://www.noneyet.ar/ * @link http://www.noneyet.ar/
*/ */
class PAMI_Autoloader class Autoloader
{ {
/** /**
* Holds current realpath. * Holds current realpath.
Expand Down Expand Up @@ -100,6 +101,6 @@ public static function register()
DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,
array(realpath(dirname(__FILE__)), '..', '..') 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.