本文整理汇总了PHP中DxdUtil::return_bytes方法的典型用法代码示例。如果您正苦于以下问题:PHP DxdUtil::return_bytes方法的具体用法?PHP DxdUtil::return_bytes怎么用?PHP DxdUtil::return_bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DxdUtil
的用法示例。
在下文中一共展示了DxdUtil::return_bytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionEnv
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionEnv()
{
$privates = array();
$privates['cache'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../caches");
$privates['upload'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../uploads");
$privates['asset'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../assets");
$privates['protected'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../protected");
$privates['theme'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../themes");
$privates['css'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../css");
$privates['js'] = DxdUtil::isWriteable(Yii::app()->basePath . "/../js");
$exts = array();
$exts['curl'] = function_exists('curl_init');
$exts['gd'] = function_exists('gd_info');
$exts['pdo_mysql'] = extension_loaded('pdo_mysql');
$exts['mysqli'] = extension_loaded('mysqli');
$exts['dom'] = extension_loaded('dom');
$phpVersion = substr(PHP_VERSION, 0, 3) >= 5.2;
$maxFileSize = floor(min(DxdUtil::return_bytes(ini_get('post_max_size')), DxdUtil::return_bytes(ini_get('upload_max_filesize')), DxdUtil::return_bytes(ini_get('memory_limit'))) / 1024 / 1024);
$pass = true;
foreach ($exts as $ext) {
if (!$ext) {
$pass = false;
}
}
foreach ($privates as $item) {
if (!$item) {
$pass = false;
}
}
if (!$phpVersion) {
$pass = false;
}
if ($maxFileSize < 2) {
$pass = false;
}
$this->render('env', array('privates' => $privates, 'exts' => $exts, 'pass' => $pass, 'phpVersion' => $phpVersion, 'maxFileSize' => $maxFileSize));
}
示例2: floor
<?php
/* @var $this NewsController */
/* @var $model News */
/* @var $form CActiveForm */
$maxFileSize = floor(min(DxdUtil::return_bytes(ini_get('post_max_size')), DxdUtil::return_bytes(ini_get('upload_max_filesize')), DxdUtil::return_bytes(ini_get('memory_limit'))) / 1024 / 1024);
$cloudStorageForm = new CloudStorageForm();
$cloudStorageForm->getSetting();
$storage = $cloudStorageForm->storage;
?>
<div class="form">
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'news-form', 'enableAjaxValidation' => false, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
?>
<?php
echo $form->errorSummary($model);
?>
<?php
echo $form->textFieldRow($model, 'title', array('class' => 'input-block-level'));
?>
<?php
echo $form->radioButtonListInlineRow($model, 'isFree', array('1' => '是', '0' => '否'));
?>
<?php
echo $form->textAreaRow($model, 'introduction', array('class' => 'input-block-level', 'style' => 'min-height:90px;'));
?>
<?php