public function load($strSourcePath, $strCachePath=false, $bolStore=true) {
		$strSourcePath = $this->fileFormatDir($strSourcePath);

		$strLang = self::init($this->arrAccepted, $this->strDefault, $bolStore);
		$this->strCurrent = $strLang;

		if ($strCachePath) {
			$strCachePath = $this->fileFormatDir($strCachePath);
			if (file_exists($strCachePath.$strLang.'.php')) {
				include $strCachePath.$strLang.'.php';
				if (isset($LANGVAR)) {
					$this->setData($LANGVAR);
					return $LANGVAR;
				}
			}
		}


		$strFilename = $strSourcePath.$strLang.'.'.$this->strFileFormat;
		if (!file_exists($strFilename))
			throw new \Exception('Locale file not found: '.$strFilename);

		switch ($this->strFileFormat) {
			case 'yml':
				if (!class_exists('\\Spyc'))
					throw new \Exception('Spyc YAML parser not loaded!');
				$LANGVAR = \Spyc::YAMLLoad($strFilename);
				break;

			case 'ini':
				$LANGVAR = parse_ini_file($strFilename, true);
				break;

			default:
				$LANGVAR = json_decode(file_get_contents($strFilename, true));
				break;
		}

		$this->setData($LANGVAR);

		if ($strCachePath)
			$this->writeCacheFile($strCachePath, $strLang);

		return $LANGVAR;
	}
public function load($strSourcePath, $strCachePath=false, $bolStore=true) {
		$strSourcePath = $this->fileFormatDir($strSourcePath);

		$strLang = self::init($this->arrAccepted, $this->strDefault, $bolStore);
		$this->strCurrent = $strLang;

		if ($strCachePath) {
			$strCachePath = $this->fileFormatDir($strCachePath);
			if (file_exists($strCachePath.$strLang.'.php')) {
				include $strCachePath.$strLang.'.php';
				if (isset($LANGVAR)) {
					$this->setData($LANGVAR);
					return $LANGVAR;
				}
			}
		}


		$strFilename = $strSourcePath.$strLang.'.'.$this->strFileFormat;
		if (!file_exists($strFilename))
			throw new \Exception('Locale file not found: '.$strFilename);

		switch ($this->strFileFormat) {
			case 'yml':
				if (!class_exists('\\Spyc'))
					throw new \Exception('Spyc YAML parser not loaded!');
				$LANGVAR = \Spyc::YAMLLoad($strFilename);
				break;

			case 'ini':
				$LANGVAR = parse_ini_file($strFilename, true);
				break;

			default:
				$LANGVAR = json_decode(file_get_contents($strFilename, true));
				break;
		}

		$this->setData($LANGVAR);

		if ($strCachePath)
			$this->writeCacheFile($strCachePath, $strLang);

		return $LANGVAR;
	}
public function load ( $ strSourcePath , $ strCachePath = false , $ bolStore = true ) { $ strSourcePath = $ this -> fileFormatDir ( $ strSourcePath ) ; $ strLang = self :: init ( $ this -> arrAccepted , $ this -> strDefault , $ bolStore ) ; $ this -> strCurrent = $ strLang ; if ( $ strCachePath ) { $ strCachePath = $ this -> fileFormatDir ( $ strCachePath ) ; if ( file_exists ( $ strCachePath . $ strLang . '.php' ) ) { include $ strCachePath . $ strLang . '.php' ; if ( isset ( $ LANGVAR ) ) { $ this -> setData ( $ LANGVAR ) ; return $ LANGVAR ; } } } $ strFilename = $ strSourcePath . $ strLang . '.' . $ this -> strFileFormat ; if ( ! file_exists ( $ strFilename ) ) throw new \ Exception ( 'Locale file not found: ' . $ strFilename ) ; switch ( $ this -> strFileFormat ) { case 'yml' : if ( ! class_exists ( '\\Spyc' ) ) throw new \ Exception ( 'Spyc YAML parser not loaded!' ) ; $ LANGVAR = \ Spyc :: YAMLLoad ( $ strFilename ) ; break ; case 'ini' : $ LANGVAR = parse_ini_file ( $ strFilename , true ) ; break ; default : $ LANGVAR = json_decode ( file_get_contents ( $ strFilename , true ) ) ; break ; } $ this -> setData ( $ LANGVAR ) ; if ( $ strCachePath ) $ this -> writeCacheFile ( $ strCachePath , $ strLang ) ; return $ LANGVAR ; }
Initialized the language variable

@param string $strSourcePath The source path for all localization files (.yml)
@param string $strCachePath The caching path; if specified, cache files will be enabled
@param bool $bolStore Switch to store language in the current session
@return array The language variable array
Initialized the language variable