Problems with autoload in PHP

0

I have the following autoload function of classes in my system, it works perfectly in localhost, however when I went up to the server it failed to include the class

  

Error on line: 47 :: Could not include check.class.php   /home/u291106554/public_html/home/_app/config.inc.php

I have already researched the subject, without success, I have already checked the version of php that is running on the server (it is in 5.5).

I need some help.

Code:

// AUTOLOAD DE CLASSES #######################
function __autoload($Class) {
$cDir = ['Conn', 'Helpers', 'Models', 'Library'];
$iDir = null;

foreach ($cDir as $dirname) {
    if (!$iDir && file_exists(__DIR__ . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $Class . '.class.php') && !is_dir(__DIR__ . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $Class . '.class.php')) {
        include_once (__DIR__ . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $Class . '.class.php');
        $iDir = TRUE;
    }
}

if (!$iDir) {
    trigger_error("Não foi possivel incluir {$Class}.class.php", E_USER_ERROR);
    die;
}
}
    
asked by anonymous 31.05.2016 / 22:25

0 answers