Migrating the site in Php 5.2 and the Autoloader for classes does not work

0

Good morning,

I'm migrating the company website from a dev that was in LocalWeb to our LocalWeb hosting. I migrated the DB and the files, I made all the settings of notes, however the auloader function is not working returning the error "Not possible to include"

// AUTO LOAD DE CLASSES ####################
function __autoload($Class) {

  $cDir = array('Conn', 'Helpers', 'Models', 'Library/PHPMailer', 'Class');

  $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;

    endif;

  endforeach;

  if (!$iDir):

    WSErro("Não foi possível incluir {$Class}.class.php", WS_ERROR, null);

    die;

  endif;

}

I have tried several other ways, but the error persists.

    
asked by anonymous 30.04.2018 / 15:43

0 answers