示例#1
0
 /**
  *
  *
  *
  *
  **/
 public function addFile($file, $path = NULL, $var = NULL)
 {
     $this->log()->logDebug('FILE [' . $file . '] PATH [' . $path . '] VAR [' . $var . ']');
     $check_var = 'LANG';
     if (isset($var)) {
         $var = str_ireplace('$', '', $var);
         eval('global $' . $var . ';');
         eval("\$lang_var = & \${$var};");
         $check_var = $var;
     }
     if (!empty($path)) {
         array_unshift(self::$search_paths, $path);
         self::$search_paths = array_unique(self::$search_paths);
     }
     foreach (self::$search_paths as $path) {
         $file = CAT_Helper_Directory::sanitizePath($path . '/' . $file);
         if (file_exists($file) && !$this->isLoaded($file)) {
             $this->log()->logDebug('found language file: ', $file);
             $this->checkFile($file, $check_var);
         }
     }
     if (!$this->isLoaded($file)) {
         $this->log()->logDebug('language file does not exist: ', $file);
         return false;
     }
     return true;
 }