Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $documentRoot = $this->getConfig("DocumentRootConnect");
     if (str_ends_with($documentRoot, "/")) {
         $documentRoot = substr($documentRoot, 0, -1);
     }
     $this->templatesDirectory = $_SERVER["DOCUMENT_ROOT"] . $documentRoot . DIRECTORY_SEPARATOR . $this->getConfig("TemplatesDirectory");
     $this->cacheDirectory = $_SERVER["DOCUMENT_ROOT"] . $documentRoot . DIRECTORY_SEPARATOR . $this->getConfig("CacheDirectory");
     $this->baseDirectory = $_SERVER["DOCUMENT_ROOT"] . $documentRoot;
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $routes = SettingsService::getInstance()->getValueFor("Routes");
     foreach ($routes as $route) {
         $this->controllers[$route["Controller"]] = new ControllerModel($route["Url"], $route["Controller"]);
     }
     $menuInfo = $this->getConfig("Menus");
     foreach ($menuInfo as $menu) {
         foreach ($menu["Entries"] as $item) {
             if (isset($this->getControllers()[$item["Controller"]])) {
                 $this->menus[$menu["Name"]] = new IconMenuItem($item["Name"], $this->controllers[$item["Controller"]]->getUrl(), $item["Icon"]);
             } else {
                 LogHelper::getInstance()->logError("unknown controller used in menu: " . $item["Controller"]);
             }
         }
     }
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     //parse language resources
     if ($this->getConfig("DefaultLanguage") == null) {
         LogHelper::getInstance()->logWarning("Default language not configured, switching to first available language");
         $this->activeLangShort = $this->getConfig("LanguageResources")[0]["Language"];
     } else {
         $this->activeLangShort = $this->getConfig("DefaultLanguage");
     }
     foreach ($this->getConfig("LanguageResources") as $languageResource) {
         $this->languages[$languageResource["Language"]] = new Language($languageResource["Language"], $languageResource, RuntimeService::getInstance()->getLocaleDirectory());
     }
     if (isset($this->languages[$this->activeLangShort])) {
         $this->activeLang = $this->languages[$this->activeLangShort];
     } else {
         $this->activeLang = array_values($this->languages)[0];
         LogHelper::getInstance()->logError("Default language not found");
     }
     setlocale(LC_ALL, $this->activeLangShort . ".utf8");
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct(false);
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct(true, "famoser\\phpFrame\\Services\\DatabaseService");
 }