本文整理汇总了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>