Esempio n. 1
0
 private static function checkFolders()
 {
     Util\Nav::createFolder(FULL_PATH . 'files/backup');
     Util\Nav::createFolder(FULL_PATH . 'files/cache');
     Util\Nav::createFolder(FULL_PATH . 'files/export');
     Util\Nav::createFolder(FULL_PATH . 'files/log');
     Util\Nav::createFolder(FULL_PATH . 'files/temp');
     Util\Nav::createFolder(FULL_PATH . 'Rebond/Cache');
 }
Esempio n. 2
0
 private function initSiteConfig()
 {
     // lang
     $langs = Config::getLang();
     $currentLang = isset($langs[0]) ? $langs : $this->lang;
     $langGet = Util\Converter::string('lang');
     if (isset($langGet)) {
         $currentLang = $langGet;
     } else {
         if (isset($_COOKIE['lang'])) {
             $currentLang = $_COOKIE['lang'];
         }
     }
     $validLang = false;
     if (isset($langs[$currentLang])) {
         $validLang = true;
     }
     if (!$validLang) {
         $currentLang = $this->lang;
     }
     $this->lang = $currentLang;
     if (!isset($_COOKIE['lang']) || $_COOKIE['lang'] != $this->lang) {
         // 7 days
         $expire = time() + 60 * 60 * 24 * 7;
         setcookie('lang', $this->lang, $expire, '/', Util\Nav::removePort($this->siteUrl));
     }
     setlocale(LC_ALL, $langs[$this->lang]);
     // site
     $this->site = \Rebond\Core\Site\Data::loadById(1);
     $this->env = $this->site->getEnvironment();
     $this->skin = $this->site->getSkin();
     if ($this->env == Config::ENV_PROD) {
         $this->setLogLevel(Config::ENV_PROD);
     }
     $this->timezone = $this->site->getTimezone();
     date_default_timezone_set($this->timezone);
 }