本文整理汇总了PHP中ConvertUtil::ConvertBytes方法的典型用法代码示例。如果您正苦于以下问题:PHP ConvertUtil::ConvertBytes方法的具体用法?PHP ConvertUtil::ConvertBytes怎么用?PHP ConvertUtil::ConvertBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConvertUtil
的用法示例。
在下文中一共展示了ConvertUtil::ConvertBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleInitEnvironment
public function handleInitEnvironment($event)
{
Ibos::app()->performance->startClock();
Ibos::app()->performance->startMemoryUsageMarker();
define("STATICURL", Ibos::app()->assetManager->getBaseUrl());
define("IN_MOBILE", EnvUtil::checkInMobile());
define("IN_DASHBOARD", EnvUtil::checkInDashboard());
define("TIMESTAMP", time());
define("IN_APP", EnvUtil::checkInApp());
$this->setTimezone();
if (function_exists("ini_get")) {
$memorylimit = @ini_get("memory_limit");
if ($memorylimit && ConvertUtil::ConvertBytes($memorylimit) < 33554432 && function_exists("ini_set")) {
ini_set("memory_limit", "128m");
}
}
$global = array("timestamp" => TIMESTAMP, "version" => VERSION, "clientip" => EnvUtil::getClientIp(), "referer" => "", "charset" => CHARSET, "authkey" => "", "newversion" => 0, "config" => array(), "setting" => array(), "user" => array(), "cookie" => array(), "session" => array(), "lunar" => DateTimeUtil::getlunarCalendar(), "title" => MainUtil::getIncentiveWord(), "staticurl" => STATICURL);
$global["phpself"] = $this->getScriptUrl();
$sitePath = substr($global["phpself"], 0, strrpos($global["phpself"], "/"));
$global["isHTTPS"] = isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off" ? true : false;
$global["siteurl"] = StringUtil::ihtmlSpecialChars("http" . ($global["isHTTPS"] ? "s" : "") . "://" . $_SERVER["HTTP_HOST"] . $sitePath . "/");
$url = parse_url($global["siteurl"]);
$global["siteroot"] = isset($url["path"]) ? $url["path"] : "";
$global["siteport"] = empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == "80" || $_SERVER["SERVER_PORT"] == "443" ? "" : ":" . $_SERVER["SERVER_PORT"];
$config = @(include PATH_ROOT . "/system/config/config.php");
if (empty($config)) {
throw new NotFoundException(Ibos::Lang("Config not found", "error"));
} else {
$global["config"] = $config;
}
Ibos::app()->setting->copyFrom($global);
}
示例2: checkUserSize
protected function checkUserSize()
{
$userSize = EmailUtil::getUserSize($this->uid);
$usedSize = EmailFolder::model()->getUsedSize($this->uid);
if (ConvertUtil::ConvertBytes($userSize . "m") < $usedSize) {
$this->error(Ibos::lang("Capacity overflow", "", array("{size}" => $usedSize)), $this->createUrl("email/list"));
}
}