2008年12月17日星期三

Re: [fw-mvc] Action Controllers extending custom one and include path in version 1.7.1

> ZF does not manipulate the include_path.

Actually it does.
Zend_Loader calls set_include_path() in the loadFile() function.


> Autoloading of controllers has never been supported, and we use
> Zend_Loader::loadClass() within the dispatcher, passing it a directory
> in which to look for the class file,

Correct, but loadClass() in turn calls loadFile() which calls
set_include_path() which sets the new path by adding the controllers
directories to it as I configured them when creating the front controller!

(actually I dont even need to configure the controllers directories if I use
a standard layout e.g. application/modules/default/controllers)

> This mechanism would never be used to find a custom base
> controller class, as that class would never be loaded by the dispatcher.
> ZF is not at fault here; something has changed in your environment or
> code.

I just switch the Zend library directory from the 1.7.1 to the 1.6.2 to make
it work, and switch it back to 1.7.1 to make it stop working.
I do not change anything else in my environment.

With 1.7.1 it does require my base action controller class to be in the
include path.
With 1.6.2 it does not.

Just try yourself :-)

--
View this message in context: http://www.nabble.com/Action-Controllers-extending-custom-one-and-include-path-in-version-1.7.1-tp21021017p21060823.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: