コード例 #1
0
 public function __construct()
 {
     parent::__construct();
     if (!isset($_SESSION)) {
         session_start();
     }
     $this->input = new Input($_REQUEST ?: array());
     $global = $this->config->get('global');
     $this->supportedMimeTypes = $this->config->get('view.mime_types');
     if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {
         $global['protocol'] = 'https';
         $this->isSecure = true;
     } else {
         $global['protocol'] = 'http';
         $this->isSecure = false;
     }
     $domain = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : null);
     if ($domain) {
         $global['domain'] = $domain;
         $global['abs_base_url'] = "http://{$domain}";
         $global['ssl_base_url'] = "https://{$domain}";
         $global['base_url'] = $global['protocol'] . '://' . $domain;
     }
     $global['web_root'] = $_SERVER['DOCUMENT_ROOT'];
     $global['base_dir'] = dirname($global['web_root']);
     $global['uri'] = explode('?', $_SERVER['REQUEST_URI'])[0];
     $this->config->merge('global', $global);
     RoutingFactory::$config = $this->getConfig('routing');
     ViewFactory::$config = $this->getConfig('view');
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
 }