protected function load($filename)
{
$ext = substr(strrchr($filename, '.'), 1);
switch ($ext) {
case 'properties':
case 'ini':
$config = parse_ini_file($this->langFilePath, true);
break;
case 'yml':
if (!class_exists('Spyc')) {
require_once 'vendor/spyc.php';
}
$config = spyc_load_file($this->langFilePath);
break;
case 'json':
$config = json_decode(file_get_contents($this->langFilePath), true);
break;
default:
throw new InvalidArgumentException($ext . " is not a valid extension!");
}
return $config;
}