Quantcast

Autoload on Linux

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Autoload on Linux

Diego Potapczuk
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Autoload on Linux

Diego Potapczuk
it seen that the autoload in not entirely broken.


Here is my autoloader definition:
$resourceLoader = new Zend_Application_Module_Autoloader(array(
    'basePath'  => APPLICATION_PATH,
    'namespace' => 'Aew',
));

$a = new Aew_Form_Delete();     
echo $a;

$b = new Aew_Model_Orm_Tag();
echo get_class($b);

It can get the Form just fine, the problem is in the Model classes



::: 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?

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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Autoload on Linux

Diego Potapczuk
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.


Here is my autoloader definition:
$resourceLoader = new Zend_Application_Module_Autoloader(array(
    'basePath'  => APPLICATION_PATH,
    'namespace' => 'Aew',
));

$a = new Aew_Form_Delete();     
echo $a;

$b = new Aew_Model_Orm_Tag();
echo get_class($b);

It can get the Form just fine, the problem is in the Model classes



::: 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?

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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Re: Autoload on Linux

Kevin Schroeder-2

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]]
Sent: Friday, January 15, 2010 7:50 AM
To: Zend Framework General
Subject: [fw-general] Re: Autoload 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.


Here is my autoloader definition:

$resourceLoader = new Zend_Application_Module_Autoloader(array(
    'basePath'  => APPLICATION_PATH,
    'namespace' => 'Aew',
));

$a = new Aew_Form_Delete();     
echo $a;

$b = new Aew_Model_Orm_Tag();
echo get_class($b);

It can get the Form just fine, the problem is in the Model classes



::: 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?

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

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Re: Autoload on Linux

drm-4
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
Loading...