Permalink
Browse files

fixed phar autoloader

  • Loading branch information...
1 parent f6f18dc commit f0da859ddee00a0888a7eeeb9acd638251be1d6a @marcelog committed Feb 9, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 resources/generatePhar.php
@@ -2,6 +2,13 @@
$stub =
'<?php
Phar::mapPhar();
+spl_autoload_register(function ($class) {
+ $classFile = "phar://pami.phar/" . str_replace("\\\", "/", $class) . ".php";
+ if (file_exists($classFile)) {
+ require_once $classFile;
+ return true;
+ }
+});
include "phar://pami.phar/PAMI/Autoloader/Autoloader.php";
\PAMI\Autoloader\Autoloader::register();
__HALT_COMPILER();
@@ -10,3 +17,4 @@
$phar->setAlias('pami.phar');
$phar->buildFromDirectory($argv[2]);
$phar->setStub($stub);
+

0 comments on commit f0da859

Please sign in to comment.