/**
* Constructor method to instantiate the default controller object
*
* @param Request $request
* @param Response $response
* @param Project $project
* @param string $viewPath
* @return self
*/
public function __construct(Request $request = null, Response $response = null, Project $project = null, $viewPath = null)
{
if (null === $viewPath) {
$cfg = $project->module('Phire')->asArray();
$viewPath = __DIR__ . '/../../../../../view/phire/install';
if (isset($cfg['view'])) {
$class = get_class($this);
if (is_array($cfg['view']) && isset($cfg['view'][$class])) {
$viewPath = $cfg['view'][$class];
} else {
if (is_array($cfg['view']) && isset($cfg['view']['*'])) {
$viewPath = $cfg['view']['*'] . '/install';
} else {
if (is_string($cfg['view'])) {
$viewPath = $cfg['view'] . '/install';
}
}
}
}
}
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'en_US';
if (!defined('POP_LANG')) {
define('POP_LANG', $lang);
}
$this->i18n = I18n::factory();
$this->i18n->loadFile($_SERVER['DOCUMENT_ROOT'] . BASE_PATH . APP_PATH . '/vendor/Phire/data/assets/i18n/' . $this->i18n->getLanguage() . '.xml');
parent::__construct($request, $response, $project, $viewPath);
$this->sess = Session::getInstance();
}