ezrpg-legacy / ezrpg-2.0.X-discontinued-

http://ezrpgproject.net
Other
6 stars 0 forks source link

Autloader messes up file path #25

Closed JakeBooher closed 11 years ago

JakeBooher commented 11 years ago

Autoloader appears to be messing with the filepath to classes when using CentOS.

Fatal error: Uncaught exception 'Exception' with message 'Autoloader could not find "/home3/ezrpg/public_html/demos/2//home3/ezrpg/public/html/demos/2/Library/Container.php"' in /home3/ezrpg/public_html/demos/2/Library/Autoloader.php:55 Stack trace: #0 [internal function]: ezRPG\Library\Autoloader->loadClass('ezRPG\Library\C...') #1 /home3/ezrpg/public_html/demos/2/Web/index.php(26): spl_autoload_call('ezRPG\Library\C...') #2 {main} thrown in /home3/ezrpg/public_html/demos/2/Library/Autoloader.php on line 55

Appears to be appending the directory structure twice before the class name.

/home3/ezrpg/public_html/demos/2//home3/ezrpg/public/html/demos/2/Library/Container.php
JakeBooher commented 11 years ago

var_dump

object(Exception)#2 (7) {
  ["message":protected]=>
  string(119) "Autoloader could not find "/home3/ezrpg/public_html/demos/2//home3/ezrpg/public/html/demos/2/Library/Container.php""
  ["string":"Exception":private]=>
  string(0) ""
  ["code":protected]=>
  int(0)
  ["file":protected]=>
  string(57) "/home3/ezrpg/public_html/demos/2/Library/Autoloader.php"
  ["line":protected]=>
  int(55)
  ["trace":"Exception":private]=>
  array(2) {
    [0]=>
    array(4) {
      ["function"]=>
      string(9) "loadClass"
      ["class"]=>
      string(24) "ezRPG\Library\Autoloader"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        string(23) "ezRPG\Library\Container"
      }
    }
    [1]=>
    array(4) {
      ["file"]=>
      string(48) "/home3/ezrpg/public_html/demos/2/Web/index.php"
      ["line"]=>
      int(27)
      ["function"]=>
      string(17) "spl_autoload_call"
      ["args"]=>
      array(1) {
        [0]=>
        string(23) "ezRPG\Library\Container"
      }
    }
  }
  ["previous":"Exception":private]=>
  NULL
}
JakeBooher commented 11 years ago

Also appears to be changing public_html to public/html due to

$fileName  = str_replace(array('\\', '_'), DIRECTORY_SEPARATOR, $namespace);