public static function get_info() { $data = array('exec_time' => Utils::get_microtime() - Container::get('start')); $data['nb_queries'] = isset(DB::get_query_log()[0]) ? count(DB::get_query_log()[0]) : 'N/A'; $data['mem_usage'] = function_exists('memory_get_usage') ? Utils::file_size(memory_get_usage()) : 'N/A'; $data['mem_peak_usage'] = function_exists('memory_get_peak_usage') ? Utils::file_size(memory_get_peak_usage()) : 'N/A'; return $data; }
public static function get_info() { self::$feather = \Slim\Slim::getInstance(); $data = array('exec_time' => Utils::get_microtime() - self::$feather->start); $data['nb_queries'] = isset(DB::get_query_log()[0]) ? count(DB::get_query_log()[0]) : 'N/A'; $data['mem_usage'] = function_exists('memory_get_usage') ? Utils::file_size(memory_get_usage()) : 'N/A'; $data['mem_peak_usage'] = function_exists('memory_get_peak_usage') ? Utils::file_size(memory_get_peak_usage()) : 'N/A'; return $data; }
public function get_total_size() { $total = array(); if (ForumSettings::get('db_type') == 'mysql' || ForumSettings::get('db_type') == 'mysqli' || ForumSettings::get('db_type') == 'mysql_innodb' || ForumSettings::get('db_type') == 'mysqli_innodb') { // Calculate total db size/row count $result = DB::for_table('users')->raw_query('SHOW TABLE STATUS LIKE \'' . ForumSettings::get('db_prefix') . '%\'')->find_many(); $result = Container::get('hooks')->fire('model.admin.model.statistics.get_total_size.raw_data', $result); $total['size'] = $total['records'] = 0; foreach ($result as $status) { $total['records'] += $status['Rows']; $total['size'] += $status['Data_length'] + $status['Index_length']; } $total['size'] = Utils::file_size($total['size']); } $total = Container::get('hooks')->fire('model.admin.model.statistics.get_total_size.total', $total); return $total; }
<div class="infldset"> <input type="hidden" name="form_sent" value="1" /> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo ForumSettings::get('o_avatars_size'); ?> " /> <label class="required"><strong><?php _e('File'); ?> <span><?php _e('Required'); ?> </span></strong><br /><input name="req_file" type="file" size="40" /><br /></label> <p><?php _e('Avatar desc'); echo ' ' . ForumSettings::get('o_avatars_width') . ' x ' . ForumSettings::get('o_avatars_height') . ' ' . __('pixels') . ' ' . __('and') . ' ' . Utils::forum_number_format(ForumSettings::get('o_avatars_size')) . ' ' . __('bytes') . ' (' . Utils::file_size(ForumSettings::get('o_avatars_size')) . ').'; ?> </p> </div> </fieldset> </div> <p class="buttons"><input type="submit" name="upload" value="<?php _e('Upload'); ?> " /> <a href="javascript:history.go(-1)"><?php _e('Go back'); ?> </a></p> </form> </div> </div>