Ejemplo n.º 1
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     // RUN STATISTICS SCRIPT AND THE SET THE RESULT
     $result = StatisticsLib::make_stats();
     // PREPARE DATA TO PARSE
     $parse = $this->_lang;
     $parse['memory_p'] = str_replace(array("%p", "%m"), $result['memory_peak'], $this->_lang['sb_top_memory']);
     $parse['memory_e'] = str_replace(array("%e", "%m"), $result['end_memory'], $this->_lang['sb_final_memory']);
     $parse['memory_i'] = str_replace(array("%i", "%m"), $result['initial_memory'], $this->_lang['sb_start_memory']);
     $parse['alert'] = AdministrationLib::save_message('ok', str_replace("%t", $result['totaltime'], $this->_lang['sb_stats_update']));
     // UPDATE STATISTICS LAST UPDATE
     FunctionsLib::update_config('stat_last_update', $result['stats_time']);
     // SHOW TEMPLATE
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/buildstats_view'), $parse));
 }
Ejemplo n.º 2
0
 /**
  * updateStatistics
  *
  * @return void
  */
 private function updateStatistics()
 {
     // LAST UPDATE AND UPDATE INTERVAL, EX: 15 MINUTES
     $stat_last_update = FunctionsLib::read_config('stat_last_update');
     $update_interval = FunctionsLib::read_config('stat_update_time');
     if (time() >= $stat_last_update + 60 * $update_interval) {
         $result = StatisticsLib::make_stats();
         FunctionsLib::update_config('stat_last_update', $result['stats_time']);
     }
 }