public function __construct() { parent::__construct(); $_ENV['environment'] = $this->config['environment']; // Setup Whoops if we're in development if ($_ENV['environment'] == 'development') { $whoops = new \Whoops\Run(); $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler()); $whoops->register(); } // Make the request class a little easier to access. class_alias('Unf\\Request', 'Request'); // Setup database and templating $this->setupDatabaseConnection(); $this->setupViewEngine(); // Set current language // TODO: allow changing of this via the AdminCP and UserCP Language::register('EnglishAu', new EnglishAu()); Language::setCurrent('EnglishAu'); require __DIR__ . '/common.php'; $this->getCurrentUser(); }
/** * @param string $string * @param array $args * * @return string */ function t($string, $args = []) { return Language::translate($string, $args); }