Search code examples
phpclassfuelphpautoloader

PHP "Helper Class" - Class not found


I am having an issue that coming from PHP 5.3.2 to 5.3.3 the code no longer can find the "I2A2" class.

Here is some info:

Error: ErrorException [ Error ]: Class 'I2A2' not found

Fatal error: Class 'I2A2' not found in /var/www/html/root/sandbox/lpolicin/t6/fuel/app/classes/observer/selectcustomer.php on line 6

$directory_listing = \I2A2::get_customer_info("puid",$customer->puid);

Code:

"classes/observer/selectcustomer.php "

class Observer_Selectcustomer extends Orm\Observer 
{

    public function after_load(Model_Customer $customer)
    {
        $directory_listing = \I2A2::get_customer_info("puid",$customer->puid);
    }
}

"classes/I2A2.php"

class I2A2 
{
    if (static::$initalized === true)
    {
        return;
    }
}

Auto loader (this is insert into a huge array then auto loads everyting)....

{
    'always_load'   => array(
     'classes'  => array(),
}

If you need more info please let me know!


Solution

  • Check your paths: the first is correctly fully lowercase but the second suddenly has the filename uppercase. All paths in Fuel are fully lowercase, no matter the classname. Thus change the filename for the I2A2 class to i2a2.php and it'll work.