1

I'am moving a website to another server and after trying to load it I got an error:

Fatal error: Class 'CI' not found in /path_to_domain/public_html/system/cms/libraries/MX/Lang.php on line 50

The file looks like this:

class MX_Lang extends CI_Lang
{
    public function load($langfile = array(), $lang = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '', $_module = '')   {

        if (is_array($langfile)) {
            foreach($langfile as $_lang) $this->load($_lang);
            return $this->language;
        }

        $deft_lang = CI::$APP->config->item('language');
        $idiom = ($lang == '') ? $deft_lang : $lang;

        if (in_array($langfile.'_lang'.EXT, $this->is_loaded, TRUE))
            return $this->language;
        $_module OR $_module = CI::$APP->router->fetch_module();
        list($path, $_langfile) = Modules::find($langfile.'_lang', $_module, 'language/'.$idiom.'/');
        if ($path === FALSE) {

            if ($lang = parent::load($langfile, $lang, $return, $add_suffix, $alt_path)) return $lang;

        } else {
            if($lang = Modules::load_file($_langfile, $path, 'lang')) {
                if ($return) return $lang;
                $this->language = array_merge($this->language, $lang);
                $this->is_loaded[] = $langfile.'_lang'.EXT;
                unset($lang);
            }
        }

        return $this->language;
    } 
}

I set the same PHP version that it was on the older server: 5.2 I set all the variables in a /public_html/system/cms/config/config.php

It looks like the HMVC files just cannot load codeigniter CI classes. Have you got any idea why it happens?

Best regards.

  • The first thing I would do is confirm my `APPPATH`, `BASEPATH` and `SYSDIR` are being set correctly in index.php. – Jerry Oct 03 '16 at 21:40
  • I belive they are correct, can you confirm? I don't know a lot about codeigniter. **SYSDIR**: codeigniter **APPPATH**: system/cms/ **BASEPATH**: /path_to_website/system/codeigniter/ – n0timportant Oct 04 '16 at 07:33

0 Answers0