Exemple #1
0
 public function __construct()
 {
     global $autoloader;
     parent::__construct();
     static::$loader = $autoloader;
     require __DIR__ . '/version.php';
     // Connect to the database
     $db = $this->config['db'][$this->config['environment']];
     // $GLOBALS['db'] = DriverManager::getConnection([
     $GLOBALS['db'] = ConnectionManager::create(['dbname' => $db['database'], 'user' => $db['username'], 'password' => $db['password'], 'host' => $db['host'], 'driver' => $db['driver'], 'prefix' => $db['prefix']]);
     define('PREFIX', $db['prefix']);
     unset($db);
     // Alias some commonly used classes
     class_alias('Avalon\\Templating\\View', 'View');
     class_alias('Avalon\\Http\\Request', 'Request');
     class_alias('Avalon\\Hook', 'Hook');
     class_alias('Traq\\Helpers\\Errors', 'Errors');
     class_alias('Traq\\Helpers\\Format', 'Format');
     class_alias('Traq\\Helpers\\Ticketlist', 'Ticketlist');
     class_alias('Traq\\Helpers\\TicketFilters', 'TicketFilters');
     class_alias('Avalon\\Helpers\\HTML', 'HTML');
     class_alias('Avalon\\Helpers\\Form', 'Form');
     class_alias('Avalon\\Helpers\\TWBS', 'TWBS');
     class_alias('Avalon\\Helpers\\Gravatar', 'Gravatar');
     // Load commonly used functions
     require __DIR__ . '/common.php';
     View::loadFunctions();
     // If a theme is set, prepend it's views directory
     if (setting('theme') !== 'default') {
         View::addPath(__DIR__ . '/../' . setting('theme') . '/views', true);
     }
     $this->loadTranslations();
     $this->loadPlugins();
     // Set mailer config
     if (isset($this->config['email'])) {
         Notification::setConfig($this->config['email']);
     }
 }
Exemple #2
0
 /**
  * Setup Avalon templating to use the extended PHP engine.
  */
 protected function setupViewEngine()
 {
     $engine = new PhpExtended();
     $engine->escapeVariables = false;
     View::setEngine($engine);
     View::addPath($this->path . '/views');
 }
Exemple #3
0
 /**
  * Setup the view class.
  */
 protected function configureTemplating()
 {
     View::setEngine(new \Avalon\Templating\Engines\PhpEngine());
     View::addPath("{$this->path}/views");
 }
Exemple #4
0
 /**
  * Configure templating.
  */
 protected function configureTemplating()
 {
     $engine = new PhpExtended();
     $engine->escapeVariables = false;
     View::setEngine($engine);
     View::addPath("{$this->path}/views");
     View::loadFunctions();
 }
Exemple #5
0
 protected function configureTemplating()
 {
     View::setEngine(new PhpExtended());
     View::addPath(dirname(__DIR__) . '/views');
 }