n00b having problems with autoloader
Posted: January 11th, 2013, 3:57 pm
Hi there, I'm having problems porting my existing php app which makes use of spl_autoload_register etc.
The phalanger config I'm using is pretty much straight out of the box, and the php app works happily under fast-cgi on iis.
Having googled for a number of hours I can't see anything obvious that would make my autoloader not work, and I can see from phalanger 3 svn repo that there is code in place to support autoloading.
The autoloader code is a pretty straightforward 'swap underscore for separator and rely on the default implementation' ..
... so I'm operating under the assumption that there is some config that I'm missing.
Can anyone help me get this going?
thanks
The phalanger config I'm using is pretty much straight out of the box, and the php app works happily under fast-cgi on iis.
Having googled for a number of hours I can't see anything obvious that would make my autoloader not work, and I can see from phalanger 3 svn repo that there is code in place to support autoloading.
The autoloader code is a pretty straightforward 'swap underscore for separator and rely on the default implementation' ..
- Code: Select all
set_include_path(get_include_path().PATH_SEPARATOR.CLASS_DIR);
spl_autoload_extensions('.php');
spl_autoload_register(function ($class){return spl_autoload(strtolower(str_replace('_', '/', $class)));});
... so I'm operating under the assumption that there is some config that I'm missing.
Can anyone help me get this going?
thanks