本文整理汇总了PHP中Vtiger_Functions::parseBytes方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::parseBytes方法的具体用法?PHP Vtiger_Functions::parseBytes怎么用?PHP Vtiger_Functions::parseBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::parseBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigurationValue
public static function getConfigurationValue($instalMode = false)
{
$errorReportingValue = 'E_WARNING & E_ERROR & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT';
$directiveValues = array('PHP' => array('prefer' => '5.4.0'), 'error_reporting' => array('prefer' => $errorReportingValue), 'output_buffering' => array('prefer' => 'On'), 'max_execution_time' => array('prefer' => '600'), 'memory_limit' => array('prefer' => '512 MB'), 'safe_mode' => array('prefer' => 'Off'), 'display_errors' => array('prefer' => 'Off'), 'log_errors' => array('prefer' => 'Off'), 'file_uploads' => array('prefer' => 'On'), 'register_globals' => array('prefer' => 'On'), 'short_open_tag' => array('prefer' => 'On'), 'post_max_size' => array('prefer' => '50 MB'), 'upload_max_filesize' => array('prefer' => '50 MB'), 'max_allowed_packet' => array('prefer' => '10 MB'), 'max_input_vars' => array('prefer' => '5000'), 'magic_quotes_gpc' => array('prefer' => 'Off'), 'magic_quotes_runtime' => array('prefer' => 'Off'), 'zlib.output_compression' => array('prefer' => 'Off'), 'zend.ze1_compatibility_mode' => array('prefer' => 'Off'), 'session.auto_start' => array('prefer' => 'Off'), 'magic_quotes_sybase' => array('prefer' => 'Off'), 'session.gc_maxlifetime' => array('prefer' => '21600'), 'session.gc_divisor' => array('prefer' => '500'), 'session.gc_probability' => array('prefer' => '1'), 'mbstring.func_overload' => array('prefer' => 'Off'));
if (extension_loaded('suhosin')) {
$directiveValues['suhosin.session.encrypt'] = array('prefer' => 'Off');
$directiveValues['suhosin.request.max_vars'] = array('prefer' => '5000');
$directiveValues['suhosin.post.max_vars'] = array('prefer' => '5000');
$directiveValues['suhosin.post.max_value_length'] = array('prefer' => '1500000');
}
if (ini_get('safe_mode') == '1' || stripos(ini_get('safe_mode'), 'On') !== false) {
$directiveValues['safe_mode']['status'] = true;
}
$directiveValues['safe_mode']['current'] = self::getFlag(ini_get('safe_mode'));
if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) {
$directiveValues['display_errors']['status'] = true;
}
$directiveValues['display_errors']['current'] = self::getFlag(ini_get('display_errors'));
if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) {
$directiveValues['file_uploads']['status'] = true;
}
$directiveValues['file_uploads']['current'] = self::getFlag(ini_get('file_uploads'));
if (ini_get('register_globals') == '1' || stripos(ini_get('register_globals'), 'On') !== false) {
$directiveValues['register_globals']['status'] = true;
}
$directiveValues['register_globals']['current'] = self::getFlag(ini_get('register_globals'));
if (ini_get('output_buffering' < '4096' && ini_get('output_buffering') != '0') || stripos(ini_get('output_buffering'), 'Off') !== false) {
$directiveValues['output_buffering']['status'] = true;
}
$directiveValues['output_buffering']['current'] = self::getFlag(ini_get('output_buffering'));
if (ini_get('max_execution_time') < 600) {
$directiveValues['max_execution_time']['status'] = true;
}
$directiveValues['max_execution_time']['current'] = ini_get('max_execution_time');
if (Vtiger_Functions::parseBytes(ini_get('memory_limit')) < 33554432) {
$directiveValues['memory_limit']['status'] = true;
}
$directiveValues['memory_limit']['current'] = Vtiger_Functions::showBytes(ini_get('memory_limit'));
if (Vtiger_Functions::parseBytes(ini_get('post_max_size')) < 10485760) {
$directiveValues['post_max_size']['status'] = true;
}
$directiveValues['post_max_size']['current'] = Vtiger_Functions::showBytes(ini_get('post_max_size'));
if (Vtiger_Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) {
$directiveValues['upload_max_filesize']['status'] = true;
}
$directiveValues['upload_max_filesize']['current'] = Vtiger_Functions::showBytes(ini_get('upload_max_filesize'));
if (ini_get('magic_quotes_gpc') == '1' || stripos(ini_get('magic_quotes_gpc'), 'On') !== false) {
$directiveValues['magic_quotes_gpc']['status'] = true;
}
$directiveValues['magic_quotes_gpc']['current'] = self::getFlag(ini_get('magic_quotes_gpc'));
if (ini_get('magic_quotes_runtime') == '1' || stripos(ini_get('magic_quotes_runtime'), 'On') !== false) {
$directiveValues['magic_quotes_runtime']['status'] = true;
}
$directiveValues['magic_quotes_runtime']['current'] = self::getFlag(ini_get('magic_quotes_runtime'));
if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) {
$directiveValues['zlib.output_compression']['status'] = true;
}
$directiveValues['zlib.output_compression']['current'] = self::getFlag(ini_get('zlib.output_compression'));
if (ini_get('zend.ze1_compatibility_mode') == '1' || stripos(ini_get('zend.ze1_compatibility_mode'), 'On') !== false) {
$directiveValues['zend.ze1_compatibility_mode']['status'] = true;
}
$directiveValues['zend.ze1_compatibility_mode']['current'] = self::getFlag(ini_get('zend.ze1_compatibility_mode'));
if (extension_loaded('suhosin')) {
if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) {
$directiveValues['suhosin.session.encrypt']['status'] = true;
}
$directiveValues['suhosin.session.encrypt']['current'] = self::getFlag(ini_get('suhosin.session.encrypt'));
}
if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) {
$directiveValues['session.auto_start']['status'] = true;
}
$directiveValues['session.auto_start']['current'] = self::getFlag(ini_get('session.auto_start'));
if (ini_get('mbstring.func_overload') == '1' || stripos(ini_get('mbstring.func_overload'), 'On') !== false) {
$directiveValues['mbstring.func_overload']['status'] = true;
}
$directiveValues['mbstring.func_overload']['current'] = self::getFlag(ini_get('mbstring.func_overload'));
if (ini_get('magic_quotes_sybase') == '1' || stripos(ini_get('magic_quotes_sybase'), 'On') !== false) {
$directiveValues['magic_quotes_sybase']['status'] = true;
}
$directiveValues['magic_quotes_sybase']['current'] = self::getFlag(ini_get('magic_quotes_sybase'));
if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) {
$directiveValues['log_errors']['status'] = 'On';
}
$directiveValues['log_errors']['current'] = self::getFlag(ini_get('log_errors'));
if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) {
$directiveValues['short_open_tag']['status'] = 'Off';
}
$directiveValues['short_open_tag']['current'] = self::getFlag(ini_get('short_open_tag'));
if (ini_get('session.gc_maxlifetime') < 21600) {
$directiveValues['session.gc_maxlifetime']['status'] = true;
}
$directiveValues['session.gc_maxlifetime']['current'] = ini_get('session.gc_maxlifetime');
if (ini_get('session.gc_divisor') < 500) {
$directiveValues['session.gc_divisor']['status'] = true;
}
$directiveValues['session.gc_divisor']['current'] = ini_get('session.gc_divisor');
if (ini_get('session.gc_probability') < 1) {
$directiveValues['session.gc_probability']['status'] = true;
}
$directiveValues['session.gc_probability']['current'] = ini_get('session.gc_probability');
//.........这里部分代码省略.........