本文整理汇总了PHP中files::str2bytes方法的典型用法代码示例。如果您正苦于以下问题:PHP files::str2bytes方法的具体用法?PHP files::str2bytes怎么用?PHP files::str2bytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类files
的用法示例。
在下文中一共展示了files::str2bytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: memoryAllocate
public function memoryAllocate($w, $h)
{
$mem_used = function_exists('memory_get_usage') ? @memory_get_usage() : 4000000;
$mem_limit = @ini_get('memory_limit');
if ($mem_used || $mem_limit) {
$mem_limit = files::str2bytes($mem_limit);
$mem_avail = $mem_limit - $mem_used - 512 * 1024;
$mem_needed = $w * $h * 8;
if ($mem_needed > $mem_avail) {
if (@ini_set('memory_limit', $mem_limit + $mem_needed + $mem_used) === false) {
throw new Exception(__('Not enough memory to open image.'));
}
if (!$this->memory_limit) {
$this->memory_limit = $mem_limit;
}
}
}
}
示例2: setcookie
}
setcookie('okt_disable_browser_check', true, 0, $okt->config->app_path, '', isset($_SERVER['HTTPS']));
unset($oMobileDetect);
} elseif (!empty($_COOKIE['okt_use_mobile_theme']) && !empty($okt->config->theme_mobile)) {
$sOktTheme = $okt->config->theme_mobile;
} elseif (!empty($_COOKIE['okt_use_tablet_theme']) && !empty($okt->config->theme_tablet)) {
$sOktTheme = $okt->config->theme_tablet;
}
}
# URL du thème
define('OKT_THEME', $okt->config->app_path . OKT_THEMES_DIR . '/' . $sOktTheme);
# Chemin du thème
define('OKT_THEME_PATH', OKT_THEMES_PATH . '/' . $sOktTheme);
# Store upload_max_filesize in bytes
$u_max_size = files::str2bytes(ini_get('upload_max_filesize'));
$p_max_size = files::str2bytes(ini_get('post_max_size'));
if ($p_max_size < $u_max_size) {
$u_max_size = $p_max_size;
}
define('OKT_MAX_UPLOAD_SIZE', $u_max_size);
unset($u_max_size, $p_max_size);
# Mode debug ?
if ((!OKT_XDEBUG || !$okt->config->xdebug_enabled) && (defined('OKT_FORCE_DEBUG') || $okt->config->debug_enabled)) {
define('OKT_DEBUG', true);
} else {
define('OKT_DEBUG', false);
}
if (OKT_DEBUG) {
$okt->debug = new oktDebug();
error_reporting(-1);
ini_set('display_errors', 'On');