|
Anyone knows why Auto Loading may be not working on Linux?
The application crash with this error: Fatal error: Class 'Aew_Model_Orm_Tag' not found in /var/www/aew_sec/application/models/Tag.php on line 15 When trying to load Doctrine Models Doctrine::loadModels(realpath($dir)); It is working just fine on windows. ::: Diego Potapczuk |
|
it seen that the autoload in not entirely broken.
Here is my autoloader definition: $resourceLoader = new Zend_Application_Module_Autoloader(array( It can get the Form just fine, the problem is in the Model classes'basePath' => APPLICATION_PATH, 'namespace' => 'Aew', )); $a = new Aew_Form_Delete(); echo $a; $b = new Aew_Model_Orm_Tag(); echo get_class($b); ::: Diego Potapczuk On Fri, Jan 15, 2010 at 10:30 AM, Diego Potapczuk <[hidden email]> wrote: Anyone knows why Auto Loading may be not working on Linux? |
|
Ok... i found the error....
Because the linux is file case sensitive, the folder all have to begin with uppercase, don´t know why is that, because zend folders like forms and models does not need this rule, and even can be in plural form. So IMHO this is a bug. ::: Diego Potapczuk On Fri, Jan 15, 2010 at 10:45 AM, Diego Potapczuk <[hidden email]> wrote: it seen that the autoload in not entirely broken. |
|
Forms and models actually do need the rule too, but it has
already been predefined in the resource autoloader. In order to have any class
loader automatically do case-insensitive checking or automated checking of
plurals, supporting several operating systems, would require a fair amount of
additional overhead, much of which would be file system calls. And one of the
things you don’t need is more file system calls. Rather than being a bug,
this is part of working on a file system that is case sensitive, and also one
of the drawbacks of developing in a different type of environment from your
production system. Kevin From: Diego Potapczuk
[mailto:[hidden email]] Ok... i found the error.... On Fri, Jan 15, 2010 at 10:45 AM, Diego Potapczuk <[hidden email]> wrote: it seen that the autoload in not entirely broken. $resourceLoader = new
Zend_Application_Module_Autoloader(array( It can get the Form just fine, the problem is in the Model
classes
On Fri, Jan 15, 2010 at 10:30 AM, Diego Potapczuk <[hidden email]>
wrote: Anyone knows why Auto Loading may be not working on Linux? |
|
In reply to this post by Diego Potapczuk
Hi Diego,
> Because the linux is file case sensitive, the folder all have to begin > with uppercase, don´t know why is that, because zend folders like > forms and models does not need this rule, and even can be in plural > form. So IMHO this is a bug. This is probably a difference in implementation by the Zend Autoloader and the Doctrine one. However, it is always good practice to assume everything is case sensitive, rather than assume everything is case-insensitive, since on unix-like systems virtually anything is, and case-sensitive code will run on a case-insensitive machine, but not the other way around. Gerard |
| Powered by Nabble | Edit this page |
