本文整理汇总了PHP中Piwik::getMemoryLimitValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::getMemoryLimitValue方法的具体用法?PHP Piwik::getMemoryLimitValue怎么用?PHP Piwik::getMemoryLimitValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::getMemoryLimitValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSystemInformation
//.........这里部分代码省略.........
if(!in_array($desired_extension, $extensions))
{
$infos['missing_desired_extensions'][] = $desired_extension;
}
}
$desired_functions = array(
'set_time_limit',
'mail',
'parse_ini_file',
'glob',
);
$infos['desired_functions'] = $desired_functions;
$infos['missing_desired_functions'] = array();
foreach($desired_functions as $desired_function)
{
if(!self::functionExists($desired_function))
{
$infos['missing_desired_functions'][] = $desired_function;
}
}
$infos['openurl'] = Piwik_Http::getTransportMethod();
$infos['gd_ok'] = false;
if (in_array('gd', $extensions))
{
$gdInfo = gd_info();
$infos['gd_version'] = $gdInfo['GD Version'];
preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
if($gdVersion[0] >= 2)
{
$infos['gd_ok'] = true;
}
}
$infos['hasMbstring'] = false;
$infos['multibyte_ok'] = true;
if(function_exists('mb_internal_encoding'))
{
$infos['hasMbstring'] = true;
if (((int) ini_get('mbstring.func_overload')) != 0)
{
$infos['multibyte_ok'] = false;
}
}
$serverSoftware = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
$infos['serverVersion'] = addslashes($serverSoftware);
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
$infos['memoryMinimum'] = $minimumMemoryLimit;
$infos['memory_ok'] = true;
$infos['memoryCurrent'] = '';
$raised = Piwik::raiseMemoryLimitIfNecessary();
if(($memoryValue = Piwik::getMemoryLimitValue()) > 0)
{
$infos['memoryCurrent'] = $memoryValue.'M';
$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
}
$infos['isWindows'] = Piwik_Common::isWindows();
$integrityInfo = Piwik::getFileIntegrityInformation();
$infos['integrity'] = $integrityInfo[0];
$infos['integrityErrorMessages'] = array();
if(isset($integrityInfo[1]))
{
if($infos['integrity'] == false)
{
$infos['integrityErrorMessages'][] = '<b>'.Piwik_Translate('General_FileIntegrityWarningExplanation').'</b>';
}
$infos['integrityErrorMessages'] = array_merge($infos['integrityErrorMessages'], array_slice($integrityInfo, 1));
}
$infos['timezone'] = Piwik::isTimezoneSupportEnabled();
$infos['tracker_status'] = Piwik_Common::getRequestVar('trackerStatus', 0, 'int');
$infos['protocol'] = Piwik_ProxyHeaders::getProtocolInformation();
if(Piwik_Url::getCurrentScheme() == 'http' && $infos['protocol'] !== null)
{
$infos['general_infos']['secure_protocol'] = '1';
}
if(count($headers = Piwik_ProxyHeaders::getProxyClientHeaders()) > 0)
{
$infos['general_infos']['proxy_client_headers'] = $headers;
}
if(count($headers = Piwik_ProxyHeaders::getProxyHostHeaders()) > 0)
{
$infos['general_infos']['proxy_host_headers'] = $headers;
}
return $infos;
}
示例2: getSystemInformation
/**
* Get system information
*/
public static function getSystemInformation()
{
$minimumPhpVersion = Zend_Registry::get('config')->General->minimum_php_version;
$minimumMemoryLimit = Zend_Registry::get('config')->General->minimum_memory_limit;
$infos = array();
$infos['directories'] = Piwik::checkDirectoriesWritable();
$infos['phpVersion_minimum'] = $minimumPhpVersion;
$infos['phpVersion'] = phpversion();
$infos['phpVersion_ok'] = version_compare($minimumPhpVersion, $infos['phpVersion']) === -1;
// critical errors
$extensions = @get_loaded_extensions();
$needed_extensions = array('zlib', 'SPL', 'iconv', 'Reflection');
$infos['needed_extensions'] = $needed_extensions;
$infos['missing_extensions'] = array();
foreach ($needed_extensions as $needed_extension) {
if (!in_array($needed_extension, $extensions)) {
$infos['missing_extensions'][] = $needed_extension;
}
}
$infos['pdo_ok'] = false;
if (in_array('PDO', $extensions)) {
$infos['pdo_ok'] = true;
}
$infos['adapters'] = Piwik_Db::getAdapters();
$infos['json'] = false;
if (in_array('json', $extensions)) {
$infos['json'] = true;
}
$infos['xml'] = false;
if (in_array('xml', $extensions)) {
$infos['xml'] = true;
}
$needed_functions = array('debug_backtrace', 'create_function');
$infos['needed_functions'] = $needed_functions;
$infos['missing_functions'] = array();
foreach ($needed_functions as $needed_function) {
if (!self::functionExists($needed_function)) {
$infos['missing_functions'][] = $needed_function;
}
}
// warnings
$desired_functions = array('set_time_limit', 'mail', 'parse_ini_file');
$infos['desired_functions'] = $desired_functions;
$infos['missing_desired_functions'] = array();
foreach ($desired_functions as $desired_function) {
if (!self::functionExists($desired_function)) {
$infos['missing_desired_functions'][] = $desired_function;
}
}
$infos['openurl'] = Piwik::getTransportMethod();
$infos['gd_ok'] = false;
if (in_array('gd', $extensions)) {
$gdInfo = gd_info();
$infos['gd_version'] = $gdInfo['GD Version'];
preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
if ($gdVersion[0] >= 2) {
$infos['gd_ok'] = true;
}
}
$infos['hasMbstring'] = false;
$infos['multibyte_ok'] = true;
if (function_exists('mb_internal_encoding')) {
$infos['hasMbstring'] = true;
if ((int) ini_get('mbstring.func_overload') != 0) {
$infos['multibyte_ok'] = false;
}
}
/**
* @see http://php.net/ip2long
*/
$infos['isIpv4'] = true;
if (strpos($_SERVER['REMOTE_ADDR'], ':') !== false) {
$infos['isIpv4'] = false;
}
$infos['serverVersion'] = addslashes($_SERVER['SERVER_SOFTWARE']);
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
$infos['memoryMinimum'] = $minimumMemoryLimit;
$infos['memory_ok'] = true;
// on windows the ini_get is not working?
$infos['memoryCurrent'] = '?M';
$raised = Piwik::raiseMemoryLimitIfNecessary();
if ($memoryValue = Piwik::getMemoryLimitValue()) {
$infos['memoryCurrent'] = $memoryValue . 'M';
$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
}
$infos['isWindows'] = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
$infos['protocol_ok'] = true;
$infos['protocol'] = self::getProtocolInformation();
if (Piwik_Url::getCurrentScheme() == 'http' && $infos['protocol'] !== null) {
$infos['protocol_ok'] = false;
}
$integrityInfo = Piwik::getFileIntegrityInformation();
$infos['integrity'] = $integrityInfo[0];
$infos['integrityErrorMessages'] = array();
if (isset($integrityInfo[1])) {
//.........这里部分代码省略.........
示例3: getSystemInformation
public static function getSystemInformation()
{
$minimumPhpVersion = Zend_Registry::get('config')->General->minimum_php_version;
$minimumMemoryLimit = Zend_Registry::get('config')->General->minimum_memory_limit;
$infos = array();
$infos['directories'] = Piwik::checkDirectoriesWritable();
$infos['phpVersion_minimum'] = $minimumPhpVersion;
$infos['phpVersion'] = phpversion();
$infos['phpVersion_ok'] = version_compare( $minimumPhpVersion, $infos['phpVersion']) === -1;
// critical errors
$extensions = @get_loaded_extensions();
$needed_extensions = array(
'zlib',
'SPL',
'iconv',
);
$infos['needed_extensions'] = $needed_extensions;
$infos['missing_extensions'] = array();
foreach($needed_extensions as $needed_extension)
{
if(!in_array($needed_extension, $extensions))
{
$infos['missing_extensions'][] = $needed_extension;
}
}
$infos['pdo_ok'] = false;
if(in_array('PDO', $extensions))
{
$infos['pdo_ok'] = true;
}
$infos['adapters'] = Piwik_Db::getAdapters();
$infos['json'] = false;
if(in_array('json', $extensions))
{
$infos['json'] = true;
}
$infos['xml'] = false;
if(in_array('xml', $extensions))
{
$infos['xml'] = true;
}
// warnings
$needed_functions = array(
'set_time_limit',
'mail',
);
$infos['needed_functions'] = $needed_functions;
$infos['missing_functions'] = array();
foreach($needed_functions as $needed_function)
{
if(!function_exists($needed_function))
{
$infos['missing_functions'][] = $needed_function;
}
}
$infos['openurl'] = Piwik::getTransportMethod();
$infos['gd_ok'] = false;
if (in_array('gd', $extensions))
{
$gdInfo = gd_info();
$infos['gd_version'] = $gdInfo['GD Version'];
preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
if($gdVersion[0] >= 2)
{
$infos['gd_ok'] = true;
}
}
$infos['serverVersion'] = addslashes($_SERVER['SERVER_SOFTWARE']);
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
$infos['memoryMinimum'] = $minimumMemoryLimit;
$infos['memory_ok'] = true;
// on windows the ini_get is not working?
$infos['memoryCurrent'] = '?M';
$raised = Piwik::raiseMemoryLimitIfNecessary();
if( $memoryValue = Piwik::getMemoryLimitValue() )
{
$infos['memoryCurrent'] = $memoryValue.'M';
$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
}
$infos['isWindows'] = substr(PHP_OS, 0, 3) == 'WIN';
$infos['protocol_ok'] = true;
$infos['protocol'] = self::getProtocolInformation();
//.........这里部分代码省略.........
示例4: getSystemInformation
protected function getSystemInformation()
{
$minimumPhpVersion = Zend_Registry::get('config')->General->minimum_php_version;
$minimumMemoryLimit = Zend_Registry::get('config')->General->minimum_memory_limit;
$infos = array();
$infos['directories'] = Piwik::checkDirectoriesWritable();
$infos['phpVersion_minimum'] = $minimumPhpVersion;
$infos['phpVersion'] = phpversion();
$infos['phpVersion_ok'] = version_compare($minimumPhpVersion, $infos['phpVersion']) === -1;
// critical errors
$extensions = @get_loaded_extensions();
$needed_extensions = array('PDO', 'pdo_mysql', 'zlib', 'SPL');
$infos['needed_extensions'] = $needed_extensions;
$infos['missing_extensions'] = array();
foreach ($needed_extensions as $needed_extension) {
if (!in_array($needed_extension, $extensions)) {
$infos['missing_extensions'][] = $needed_extension;
}
}
// warnings
$needed_functions = array('set_time_limit', 'mail');
$infos['needed_functions'] = $needed_functions;
$infos['missing_functions'] = array();
foreach ($needed_functions as $needed_function) {
if (!function_exists($needed_function)) {
$infos['missing_functions'][] = $needed_function;
}
}
$infos['gd_ok'] = false;
if (in_array('gd', $extensions)) {
$gdInfo = gd_info();
$infos['gd_version'] = $gdInfo['GD Version'];
preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
if ($gdVersion[0] >= 2) {
$infos['gd_ok'] = true;
}
}
$infos['serverVersion'] = addslashes($_SERVER['SERVER_SOFTWARE']);
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
$infos['memoryMinimum'] = $minimumMemoryLimit;
$infos['memory_ok'] = true;
// on windows the ini_get is not working?
$infos['memoryCurrent'] = '?M';
$raised = Piwik::raiseMemoryLimitIfNecessary();
if ($memoryValue = Piwik::getMemoryLimitValue()) {
$infos['memoryCurrent'] = $memoryValue . "M";
$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
}
return $infos;
}