Ejemplo n.º 1
0
 public function __construct()
 {
     $this->configDir = dirname(dirname(__DIR__)) . '/config';
     parent::__construct();
     require dirname(__DIR__) . '/common.php';
     class_alias('Avalon\\Http\\Request', 'Request');
     define('PREFIX', $this->config['database'][$this->config['environment']]['prefix']);
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->configDir = __DIR__ . '/config';
     parent::__construct();
     class_alias("Avalon\\Templating\\View", "View");
     class_alias("Avalon\\Http\\Request", "Request");
     class_alias("Avalon\\Helpers\\HTML", "HTML");
     require dirname(__DIR__) . "/version.php";
     require dirname(__DIR__) . "/common.php";
     define('PREFIX', '');
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->configDir = __DIR__ . '/config';
     parent::__construct();
     View::loadFunctions();
     class_alias("Avalon\\Templating\\View", "View");
     class_alias("Avalon\\Http\\Request", "Request");
     class_alias("Avalon\\Helpers\\HTML", "HTML");
     $traqDir = dirname(dirname(dirname(dirname(__DIR__)))) . '/src/';
     // I should just code for PHP 7.0+
     require $traqDir . "/version.php";
     require $traqDir . "/common.php";
     define('PREFIX', '');
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     global $autoloader;
     static::$loader = $autoloader;
     session_start();
     parent::__construct();
     require_once __DIR__ . '/version.php';
     // Setup aliases
     $this->setupAliases();
     // Load translations
     $this->loadTranslations();
     // Load common functions
     require __DIR__ . '/common.php';
     // Load plugins
     $this->loadPlugins();
 }
Ejemplo n.º 5
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']);
     }
 }