Ejemplo n.º 1
0
 private function _check_extension()
 {
     if (in_array($this->config->extension_url, array('html', 'json', 'xml', 'txt')) || is_asset()) {
         $this->_extension = TRUE;
     } else {
         $this->profiler->log('Extension .html requise dans l\'URL', Profiler::ERROR);
     }
 }
Ejemplo n.º 2
0
 public function __destruct()
 {
     $this->log('Temps écoulé depuis la requète HTTP : ' . round((microtime(TRUE) - $_SERVER['REQUEST_TIME']) * 1000, 3) . ' ms', self::INFO);
     $this->log('Temps total d\'exécution : ' . round((microtime(TRUE) - NEOFRAG_TIME) * 1000, 3) . ' ms', self::INFO);
     $this->log('Espace mémoire alloué par NeoFrag : ' . round((memory_get_peak_usage(TRUE) - NEOFRAG_MEMORY) / 1024 / 1024, 3) . ' Mo', self::INFO);
     $this->log('Espace mémoire alloué par PHP : ' . round(memory_get_peak_usage(TRUE) / 1024 / 1024, 3) . ' Mo', self::INFO);
     if (!is_asset() && file_exists(NEOFRAG_CMS . '/logs/')) {
         $f = fopen(NEOFRAG_CMS . '/logs/log.php', 'a');
         foreach ($this->_log as $log) {
             fwrite($f, timetostr('%Y-%m-%d %H:%M:%S') . ' : ' . $log[0] . "\n");
         }
         fwrite($f, str_repeat('=', 150) . "\n");
         fclose($f);
     }
 }
Ejemplo n.º 3
0
 public function __destruct()
 {
     if (!is_asset() && !$this->config->ajax_url && !$this->config->ajax_header && $_SERVER['REQUEST_METHOD'] != 'OPTIONS') {
         if (in_array($this->_get_url(), array('index.html', 'admin.html')) || empty($_SERVER['HTTP_REFERER'])) {
             $this->_user_data['session']['history'] = array($this->_get_url());
         } else {
             if (empty($this->_user_data['session']['history']) || end($this->_user_data['session']['history']) != $this->_get_url()) {
                 if (prev($this->_user_data['session']['history']) == $this->_get_url()) {
                     array_pop($this->_user_data['session']['history']);
                 } else {
                     $this->_user_data['session']['history'][] = $this->_get_url();
                 }
             }
         }
     }
     $this->save();
 }
Ejemplo n.º 4
0
 public function set_language()
 {
     $this->update($this->site, $this->nf_default_language ?: 'fr');
     setlocale(LC_ALL, $this->load->lang('locale'));
     if (!$this->ajax && is_asset()) {
         asset($this->_configs['request_url']);
     }
 }