本文整理汇总了PHP中XUtils::byteFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP XUtils::byteFormat方法的具体用法?PHP XUtils::byteFormat怎么用?PHP XUtils::byteFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XUtils
的用法示例。
在下文中一共展示了XUtils::byteFormat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionHome
/**
* 主界面
*/
public function actionHome()
{
$data['soft'] = 'bagecms';
$data['softVersion'] = $this->_bagecms;
$data['softRelease'] = $this->_bagecmsRelease;
$data['serverSoft'] = $_SERVER['SERVER_SOFTWARE'];
$data['serverOs'] = PHP_OS;
$data['phpVersion'] = PHP_VERSION;
$data['fileupload'] = ini_get('file_uploads') ? ini_get('upload_max_filesize') : '禁止上传';
$data['serverUri'] = $_SERVER['SERVER_NAME'];
$data['maxExcuteTime'] = ini_get('max_execution_time') . ' 秒';
$data['maxExcuteMemory'] = ini_get('memory_limit');
$data['magic_quote_gpc'] = MAGIC_QUOTE_GPC ? '开启' : '关闭';
$data['allow_url_fopen'] = ini_get('allow_url_fopen') ? '开启' : '关闭';
$data['excuteUseMemory'] = function_exists('memory_get_usage') ? XUtils::byteFormat(memory_get_usage()) : '未知';
$dbsize = 0;
$connection = Yii::app()->db;
$sql = 'SHOW TABLE STATUS LIKE \'' . $connection->tablePrefix . '%\'';
$command = $connection->createCommand($sql)->queryAll();
foreach ($command as $table) {
$dbsize += $table['Data_length'] + $table['Index_length'];
}
$mysqlVersion = $connection->createCommand("SELECT version() AS version")->queryAll();
$data['mysqlVersion'] = $mysqlVersion[0]['version'];
$data['dbsize'] = $dbsize ? XUtils::byteFormat($dbsize) : '未知';
$notebook = Admin::model()->findByPk($this->_admini['userId']);
$env = XUtils::b64encode(serialize($data));
$this->render('home', array('notebook' => $notebook, 'env' => $env, 'server' => $data));
}
示例2: date
<td ><p><?php
echo CHtml::encode($row->real_name);
?>
</p>
<p><?php
echo CHtml::encode($row->save_path);
?>
</p>
<p><?php
echo CHtml::encode($row->save_name);
?>
</p></td>
<!--<td ></td>-->
<td ><span ><?php
echo XUtils::byteFormat($row->file_size);
?>
</span></td>
<td ><?php
echo date('Y-m-d H:i', $row->create_time);
?>
</td>
<td ><a href="<?php
echo $this->createUrl('batch', array('command' => 'attachDelete', 'id' => $row->id));
?>
" class="confirmSubmit"><img src="<?php
echo $this->_baseUrl;
?>
/static/admin/images/delete.png" align="absmiddle" /></a></td>
</tr>
<?php
示例3:
?>
</label></td>
<td><?php
echo $row['Engine'];
?>
</td>
<td><?php
echo $row['Collation'];
?>
</td>
<td><?php
echo $row['Rows'];
?>
</td>
<td><?php
echo XUtils::byteFormat($row['Data_length']);
?>
</td>
<td><?php
echo $row['Data_free'];
?>
</td>
<td><?php
echo $row['Comment'];
?>
</td>
</tr>
<?php
}
?>
<tr class="submit">