Ah. I missed the addition of Zend_Loader_Autoloader to the framework, apparently. -Matt
On Thu, Feb 26, 2009 at 1:49 PM, Matthew Weier O'Phinney <matt...@zend.com>wrote: > -- Matthew Ratzloff <m...@builtfromsource.com> wrote > (on Thursday, 26 February 2009, 01:02 PM -0800): > > As a side note, I wish there was a way to configure Zend_Loader to > iterate over > > the include path and check is_readable() on them. I know it's much > slower, but > > it would be more convenient during development when you're watching log > > messages to not always have to filter out the include_once warnings. > Then in > > your configuration you could just turn it off for production deployments. > > Write a custom callback, then, and use it during development. > Zend_Loader_Autoloader allows you to specify the callback you wish to > use for the default autoloader implementation -- it uses > Zend_Loader::loadClass() by default, but you can override it. > > > On Thu, Feb 26, 2009 at 12:52 PM, till <klimp...@gmail.com> wrote: > > > > On Thu, Feb 26, 2009 at 9:19 PM, awkaiser > > <august.kai...@beehivemedia.com> wrote: > > > > > > This message is intended for @weierophinney, but feel free to pitch > in if > > you > > > have a solution. :) This might be an easy one for you guys! > > > > > > The short story is that I'm giving Zend_Loader_Autoloader_Resource > > > (incubator) a spin and have run into some unexpected behavior. It > seems > > to > > > load my classes correctly (my page will display with the expected > > > information from the database) but Zend_Loader complains with some > > warnings: > > > > > > Warning: Zend_Loader::include_once(Projects/Model/Projects.php) > > > [function.Zend-Loader-include-once]: failed to open stream: No such > file > > or > > > directory in /[...]/library/Zend/Loader.php on line 83 > > > > > > Warning: Zend_Loader::include_once() [function.include]: Failed > > opening > > > 'Projects/Model/Projects.php' for inclusion (include_path='[...]') > in > > > /[...]/library/Zend/Loader.php on line 83 > > > > > > Warning: > Zend_Loader::include_once(Projects/DbTable/Projects.php) > > > [function.Zend-Loader-include-once]: failed to open stream: No such > file > > or > > > directory in /[...]/library/Zend/Loader.php on line 83 > > > > > > Warning: Zend_Loader::include_once() [function.include]: Failed > > opening > > > 'Projects/DbTable/Projects.php' for inclusion > (include_path='[...]') in > > > /[...]/library/Zend/Loader.php on line 83 > > > > Somewhat related and more a question for Matthew, but is the > > *autoloader* supposed to use include_once? > > > > > So, it seems to be attempting to include the classes from my > include > > path. > > > My assumption is that Zend_Loader_Autoloader_Resource should take > care of > > > everything (like taking overriding the processing of namespaces in > such a > > > way that the default Zend_Loader actions are never executed) and I > > shouldn't > > > need to touch my include_path. > > > > > > Is there something I need to do in my bootstrap prior to using ZLAR > to > > avoid > > > that include conflict? Right now the bootstrap has nothing specific > to > > ZLAR > > > and I'm just instantiating it in my modules' index controller > init() > > > functions like so: > > > > > > $loader = new Zend_Loader_Autoloader_Resource(array( > > > 'namespace' => 'Projects', > > > 'basePath' => dirname(__FILE__) . '/..' > > > )); > > > > > > $loader->addResourceTypes(array( > > > 'Model' => array('path' => 'models', 'namespace' => > 'Model'), > > > 'DbTable' => array('path' => 'models/DbTable', 'namespace' > => > > 'DbTable') > > > )); > > > > > > ... where my directory structure is: > > > > > > /application > > > /modules (just showing one for illustration) > > > /projects > > > /controllers > > > IndexController.php > > > /forms > > > /models > > > /DbTable > > > Categories.php > > > Features.php > > > ProjectCategories.php > > > ProjectFeatures.php > > > Projects.php > > > ProjectsSimilar.php > > > Projects.php > > > /views > > > > > > Maybe I'm violating "best practices" for ZLAR, who knows. :) > Hopefully > > there > > > is a quick fix! > > > > LGTM! :) I bet the module structure throws it off somehow, I don't > > know what dirname(__FILE__) in your example resolves to, e.g., is > your > > "bootstrap" in root/app/modules/ or in /root/. > > > > Cheers, > > Till > > > > > > -- > Matthew Weier O'Phinney > Software Architect | matt...@zend.com > Zend Framework | http://framework.zend.com/ >