Esempio n. 1
0
 public function __construct($environment = null, $root_path = null)
 {
     self::$time = microtime(true);
     if (self::$active == null || $this instanceof waAppConfig) {
         self::$active = $this;
     }
     if ($root_path === null) {
         $this->root_path = realpath(dirname(__FILE__) . '/../..');
     } else {
         $this->root_path = realpath($root_path);
     }
     $this->setPath($this->root_path);
     if (!self::$helpers) {
         self::$helpers = true;
         include $this->getRootPath() . "/wa-system/helper/load.php";
     }
     $this->configure();
     $this->init();
     if ($environment === null) {
         $url = explode("/", $this->getRequestUrl(true));
         $url = $url[0];
         $this->environment = $url === $this->getSystemOption('backend_url') ? 'backend' : 'frontend';
     } else {
         $this->environment = $environment;
     }
     $url = $this->getRequestUrl();
     if ($url === 'robots.txt' || $url === 'favicon.ico' || $url == 'apple-touch-icon.png') {
         $this->responseStatic($url);
     }
 }