本文整理匯總了PHP中FeatherBB\Core\Utils::file_size方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils::file_size方法的具體用法?PHP Utils::file_size怎麽用?PHP Utils::file_size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FeatherBB\Core\Utils
的用法示例。
在下文中一共展示了Utils::file_size方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_info
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;
}
示例2: get_info
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;
}
示例3: get_total_size
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;
}
示例4:
<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>