Mike Wright wrote:
J DeBord wrote:
My code:

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace(array('Amazon_', 'Nba_'));

$filesDomain = new Nba_SimpleDb_Domain_Files;

There is a parse error in the class Nba_SimpleDb_Domain_Files.
With the code above, when executed, the screen is blank.


Rank amateur wrt ZF but I'll give this a stab.

According to the API "registerNamespace" takes a simple string, not an array. I'm guessing that you'd have to call that method twice, once for each namespace you wish to register.


Follow up:

I was looking at Matthew's example on devzone and saw that he passed
registerNamespace an array so I waddled through the source.

Turns out it checks if the method has been passed a string and, if so,
recasts it into an array.  If it is not a string it checks to see if it
is an array.  If it is not an array an exception is thrown.

So line 200 in Zend/Loader/Autoloader.php should be changed from

     * @param  string $namespace
to
     * @param  string|array $namespace

Sorry for my original bad advice :(



Reply via email to