Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-05 Thread Matthew Weier O'Phinney
-- Vadim Gabriel wrote (on Tuesday, 05 May 2009, 12:57 PM +0300): > According to the code it requires both parameters to be set. Other wise it > throws an exception. The namespace *can* be an empty string ('') however. > $namespace = $this->getNamespace(); > if ((null === $namespace) >

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-05 Thread Vadim Gabriel
Hey, Ahh that's right. if i got a quarter for every time i mixed the two... :P On Tue, May 5, 2009 at 1:03 PM, till wrote: > On Tue, May 5, 2009 at 11:57 AM, Vadim Gabriel wrote: > > Hey, > > > > According to the code it requires both parameters to be set. Other wise > it > > throws an excepti

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-05 Thread till
On Tue, May 5, 2009 at 11:57 AM, Vadim Gabriel wrote: > Hey, > > According to the code it requires both parameters to be set. Other wise it > throws an exception. > > $namespace = $this->getNamespace(); >     if ((null === $namespace) >     || (null === $this->getBasePath()) >    

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-05 Thread Vadim Gabriel
Hey, According to the code it requires both parameters to be set. Other wise it throws an exception. $namespace = $this->getNamespace(); if ((null === $namespace) || (null === $this->getBasePath()) ) { require_once 'Zend/Loader/Exception.php'; t

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-05 Thread Goran Juric
Matthew Weier O'Phinney-3 wrote: > > $loader = new Zend_Application_Module_Autoloader(array( > 'basePath' => APPLICATION_PATH, > 'namespace' => '', // no resource namespace > )); > Hi, are there any side effects of having an "empty" namespace? Regards, Goran Juric h

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread Matthew Weier O'Phinney
-- J DeBord wrote (on Sunday, 03 May 2009, 09:23 PM +0200): > On Sun, May 3, 2009 at 5:14 PM, Matthew Weier O'Phinney > wrote: > > -- J DeBord wrote > (on Sunday, 03 May 2009, 04:49 PM +0200): > > Adding namespaces to the new Autoloader works great as long as they are > in the >

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread J DeBord
On Sun, May 3, 2009 at 5:14 PM, Matthew Weier O'Phinney wrote: > -- J DeBord wrote > (on Sunday, 03 May 2009, 04:49 PM +0200): > > Adding namespaces to the new Autoloader works great as long as they are > in the > > include path. For example, a namespace 'App_' which refers to classes in > the >

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread Matthew Weier O'Phinney
-- J DeBord wrote (on Sunday, 03 May 2009, 04:49 PM +0200): > Adding namespaces to the new Autoloader works great as long as they are in the > include path. For example, a namespace 'App_' which refers to classes in the > 'App' directory that sits next to the Zend (framework) directory. > > Quest

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread J DeBord
Matthew and all, Adding namespaces to the new Autoloader works great as long as they are in the include path. For example, a namespace 'App_' which refers to classes in the 'App' directory that sits next to the Zend (framework) directory. Question: Is there anyway to autoload the classes inside

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread Mike Wright
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_

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread Matthew Weier O'Phinney
-- J DeBord wrote (on Saturday, 02 May 2009, 07:43 PM +0200): > 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

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread Matthew Weier O'Phinney
-- Mike Wright wrote (on Saturday, 02 May 2009, 11:15 AM -0700): > 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

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-03 Thread J DeBord
No worries Mike. It's just something new to learn. I am having another problem though. I've removed my /models directory from the include path and attempted to use: $modelLoader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Model', 'basePath' => APPLICATION_PATH . '/mo

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread Mike Wright
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_

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread Mike Wright
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 t

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread J DeBord
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, whe

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread J DeBord
Alright, I read the article. Great as usual. Thanks Matthew. The following paragraph caught my attention early on: "So, we then tried using the suppression operator ('@'). This gets rid of the error notices (though they still show up in logs) -- but has a really nasty side effect: if there are *p

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread J DeBord
Thanks guys! I will be reading Matthew's Dev Zone article this evening. Regarding registerNamespace(). How exactly does this work? What is the advantage? For example I'm using an Amazon SimpleDb library. I keep it in the same library directory next to my Zend (framework) directory. The library dir

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread Matthew Weier O'Phinney
-- David Mintz wrote (on Saturday, 02 May 2009, 08:54 AM -0400): > On Sat, May 2, 2009 at 8:50 AM, Matthew Weier O'Phinney > wrote: > -- J DeBord wrote > (on Saturday, 02 May 2009, 11:32 AM +0200): > > To make Zend_Loader_Autoloader match the functionality of this: > > > > re

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread David Mintz
On Sat, May 2, 2009 at 8:50 AM, Matthew Weier O'Phinney wrote: > -- J DeBord wrote > (on Saturday, 02 May 2009, 11:32 AM +0200): > > To make Zend_Loader_Autoloader match the functionality of this: > > > > require_once "Zend/Loader.php"; > > Zend_Loader::registerAutoload(); > > > > Would you do th

Re: [fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread Matthew Weier O'Phinney
-- J DeBord wrote (on Saturday, 02 May 2009, 11:32 AM +0200): > To make Zend_Loader_Autoloader match the functionality of this: > > require_once "Zend/Loader.php"; > Zend_Loader::registerAutoload(); > > Would you do this? : > > require_once 'Zend/Loader/Autoloader.php'; > $autoloader = Zend_Loa

[fw-general] Zend_Loader_Autoloader match Zend_Loader functionality

2009-05-02 Thread J DeBord
To make Zend_Loader_Autoloader match the functionality of this: require_once "Zend/Loader.php"; Zend_Loader::registerAutoload(); Would you do this? : require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); Thanks!