Skip to content

Commit

Permalink
let the autoloader handle the language files;
Browse files Browse the repository at this point in the history
that removes usage of exception, so removing unused "use" statement, too
  • Loading branch information
jakoch committed Aug 14, 2012
1 parent 480ea42 commit 56610a3
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions Installation/Application/Application.php
Expand Up @@ -27,7 +27,6 @@
namespace Clansuite\Installation\Application;

use \Clansuite\Installation\Application\Helper as Helper;
use \Clansuite\Installation\Application\Exception as Exception;

/**
* Clansuite Installation Application
Expand Down Expand Up @@ -165,25 +164,12 @@ public function handleRequest_Language()

public function loadLanguage()
{
/**
* Load Language File
*/
try {
$file = INSTALLATION_ROOT . 'Languages/' . $this->locale . '.install.php';

if (is_file($file) === true) {
include_once $file;

$classname = '\Clansuite\Installation\Language\\' . $this->locale;
$this->language = new $classname;
// Load Language File
$classname = '\Clansuite\Installation\Languages\\' . $this->locale;
$this->language = new $classname;

$_SESSION['lang'] = $this->locale;
} else {
throw new Exception('<span style="color:red">Language file missing: <strong>' . $file . '</strong></span>');
}
} catch (\Exception $e) {
exit($e);
}
// set language to session
$_SESSION['lang'] = $this->locale;
}

/**
Expand Down

0 comments on commit 56610a3

Please sign in to comment.