本文整理汇总了PHP中zend_version函数的典型用法代码示例。如果您正苦于以下问题:PHP zend_version函数的具体用法?PHP zend_version怎么用?PHP zend_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zend_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: system_information
function system_information()
{
global $mysqli, $server, $redis_server, $mqtt_server;
$result = $mysqli->query("select now() as datetime, time_format(timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')),'%H:%i') AS timezone");
$db = $result->fetch_array();
@(list($system, $host, $kernel) = preg_split('/[\\s,]+/', php_uname('a'), 5));
@exec('ps ax | grep feedwriter.php | grep -v grep', $feedwriterproc);
$meminfo = false;
if (@is_readable('/proc/meminfo')) {
$data = explode("\n", file_get_contents("/proc/meminfo"));
$meminfo = array();
foreach ($data as $line) {
if (strpos($line, ':') !== false) {
list($key, $val) = explode(":", $line);
$meminfo[$key] = 1024 * floatval(trim(str_replace(' kB', '', $val)));
}
}
}
$emoncms_modules = "";
$emoncmsModulesPath = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/')) . '/Modules';
// Set the Modules path
$emoncmsModuleFolders = glob("{$emoncmsModulesPath}/*", GLOB_ONLYDIR);
// Use glob to get all the folder names only
foreach ($emoncmsModuleFolders as $emoncmsModuleFolder) {
// loop through the folders
if ($emoncms_modules != "") {
$emoncms_modules .= " ";
}
$emoncms_modules .= str_replace($emoncmsModulesPath . "/", '', $emoncmsModuleFolder);
}
return array('date' => date('Y-m-d H:i:s T'), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => @exec('uptime'), 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : 'n/a', 'db_server' => $server, 'db_ip' => gethostbyname($server), 'db_version' => 'MySQL ' . $mysqli->server_info, 'db_stat' => $mysqli->stat(), 'db_date' => $db['datetime'] . " (UTC " . $db['timezone'] . ")", 'redis_server' => $redis_server['host'] . ":" . $redis_server['port'], 'redis_ip' => gethostbyname($redis_server['host']), 'feedwriter' => !empty($feedwriterproc), 'mqtt_server' => $mqtt_server['host'], 'mqtt_ip' => gethostbyname($mqtt_server['host']), 'mqtt_port' => $mqtt_server['port'], 'hostbyaddress' => @gethostbyaddr(gethostbyname($host)), 'http_proto' => $_SERVER['SERVER_PROTOCOL'], 'http_mode' => $_SERVER['GATEWAY_INTERFACE'], 'http_port' => $_SERVER['SERVER_PORT'], 'php_modules' => get_loaded_extensions(), 'mem_info' => $meminfo, 'partitions' => disk_list(), 'emoncms_modules' => $emoncms_modules);
}
示例2: sendPHPInfo
/**
* @param CommandSender $sender
*/
public function sendPHPInfo(CommandSender $sender)
{
$info = ["CWD" => getcwd(), "GID" => getmygid(), "PID" => getmypid(), "UID" => getmyuid(), "Memory-usage" => memory_get_usage(true), "Memory-peak-usage" => memory_get_peak_usage(true), "PHP-version" => phpversion(), "Zend-version" => zend_version()];
foreach ($info as $key => $value) {
$sender->sendMessage($key . ": " . $value);
}
}
示例3: get_system_info
function get_system_info()
{
global $gacl_api;
//Grab system info
$system_info .= 'PHP Version: ' . phpversion() . "\n";
$system_info .= 'Zend Version: ' . zend_version() . "\n";
$system_info .= 'Web Server: ' . $_SERVER['SERVER_SOFTWARE'] . "\n\n";
$system_info .= 'phpGACL Settings: ' . "\n";
$system_info .= ' phpGACL Version: ' . $gacl_api->get_version() . "\n";
$system_info .= ' phpGACL Schema Version: ' . $gacl_api->get_schema_version() . "\n";
if ($gacl_api->_caching == TRUE) {
$caching = 'True';
} else {
$caching = 'False';
}
$system_info .= ' Caching Enabled: ' . $caching . "\n";
if ($gacl_api->_force_cache_expire == TRUE) {
$force_cache_expire = 'True';
} else {
$force_cache_expire = 'False';
}
$system_info .= ' Force Cache Expire: ' . $force_cache_expire . "\n";
$system_info .= ' Database Prefix: \'' . $gacl_api->_db_table_prefix . "'\n";
$system_info .= ' Database Type: ' . $gacl_api->_db_type . "\n";
$database_server_info = $gacl_api->db->ServerInfo();
$system_info .= ' Database Version: ' . $database_server_info['version'] . "\n";
$system_info .= ' Database Description: ' . $database_server_info['description'] . "\n\n";
$system_info .= 'Server Name: ' . $_SERVER["SERVER_NAME"] . "\n";
$system_info .= ' OS: ' . PHP_OS . "\n";
$system_info .= ' IP Address: ' . $_SERVER["REMOTE_ADDR"] . "\n";
$system_info .= ' Browser: ' . $_SERVER["HTTP_USER_AGENT"] . "\n\n";
$system_info .= 'System Information: ' . php_uname() . "\n";
return trim($system_info);
}
示例4: oosGetSystemInformation
/**
* Retreive server information
*
* @return array
*/
function oosGetSystemInformation() {
// Get database information
$dbconn =& oosDBGetConn();
$oostable =& oosDBGetTables();
$db_host = $dbconn->host;
$db_database = $dbconn->database;
$phpv = phpversion();
$db_result = $dbconn->ServerInfo($oostable['countries']);
list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);
return array('date' => oos_datetime_short(date('Y-m-d H:i:s')),
'system' => $_ENV["OS"],
'kernel' => $kernel,
'host' => $host,
'ip' => gethostbyname($host),
'uptime' => @exec('uptime'),
'HTTP_SERVER' => $_SERVER['SERVER_SOFTWARE'],
'php' => $phpv,
'zend' => (function_exists('zend_version') ? zend_version() : ''),
'db_server' => $db_host,
'db_ip' => gethostbyname(OOS_DB_SERVER),
'db_version' => OOS_DB_TYPE . $db_result['description'],
'db_database' => $db_database);
}
示例5: lc_get_system_information
/**
* Retrieve web server and database server information
*
* @access public
*/
function lc_get_system_information()
{
global $lC_Database;
$Qdb_date = $lC_Database->query('select now() as datetime');
$Qdb_uptime = $lC_Database->query('show status like "Uptime"');
@(list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5));
$db_uptime = intval($Qdb_uptime->valueInt('Value') / 3600) . ':' . str_pad(intval($Qdb_uptime->valueInt('Value') / 60 % 60), 2, '0', STR_PAD_LEFT);
return array('date' => lC_DateTime::getShort(null, true), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => @exec('uptime'), 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : '', 'db_server' => DB_SERVER, 'db_ip' => gethostbyname(DB_SERVER), 'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? @mysql_get_server_info() : ''), 'db_date' => lC_DateTime::getShort($Qdb_date->value('datetime'), true), 'db_uptime' => $db_uptime);
}
示例6: copy
function copy()
{
if (version_compare(zend_version(), '2', '>')) {
return clone $this;
} else {
$xml_svg = $this;
return $xml_svg;
}
}
示例7: system_information
function system_information()
{
global $mysqli, $server, $redis_server, $mqtt_server;
$result = $mysqli->query("select now() as datetime, time_format(timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')),'%H:%i') AS timezone");
$db = $result->fetch_array();
@(list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5));
@exec('ps ax | grep feedwriter.php | grep -v grep', $feedwriterproc);
return array('date' => date('Y-m-d H:i:s T'), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => gethostbyname($host), 'uptime' => @exec('uptime'), 'http_server' => $_SERVER['SERVER_SOFTWARE'], 'php' => PHP_VERSION, 'zend' => function_exists('zend_version') ? zend_version() : 'n/a', 'db_server' => $server, 'db_ip' => gethostbyname($server), 'db_version' => 'MySQL ' . $mysqli->server_info, 'db_stat' => $mysqli->stat(), 'db_date' => $db['datetime'] . " (UTC " . $db['timezone'] . ")", 'redis_server' => $redis_server['host'] . ":" . $redis_server['port'], 'redis_ip' => gethostbyname($redis_server['host']), 'feedwriter' => !empty($feedwriterproc), 'mqtt_server' => $mqtt_server['host'], 'mqtt_ip' => gethostbyname($mqtt_server['host']), 'mqtt_port' => $mqtt_server['port'], 'hostbyaddress' => gethostbyaddr(gethostbyname($host)), 'http_proto' => $_SERVER['SERVER_PROTOCOL'], 'http_mode' => $_SERVER['GATEWAY_INTERFACE'], 'http_port' => $_SERVER['SERVER_PORT'], 'php_modules' => get_loaded_extensions());
}
示例8: getInfo
public static function getInfo()
{
@($system = php_uname('s'));
@($kernel = @php_uname('r') . ' ' . @php_uname('v') . ' ' . @php_uname('m'));
@($host = @php_uname('n'));
@($ip = @gethostbyname($host));
@($hostbyip = @gethostbyaddr($ip));
return array('version' => About::getGitBranch(), 'date' => date('Y-m-d H:i:s T'), 'system' => $system, 'kernel' => $kernel, 'host' => $host, 'ip' => $ip, 'uptime' => @exec('uptime'), 'http_server' => About::getServerVar('SERVER_SOFTWARE'), 'php' => PHP_VERSION, 'php_modules' => get_loaded_extensions(), 'zend' => function_exists('zend_version') ? zend_version() : 'n/a', 'hostbyaddress' => $hostbyip, 'http_proto' => About::getServerVar('SERVER_PROTOCOL'), 'http_mode' => About::getServerVar('GATEWAY_INTERFACE'), 'http_port' => About::getServerVar('SERVER_PORT'));
}
示例9: main
/**
* Main
*
* @param string[] args
* @return int
*/
public static function main(array $args)
{
Console::writeLinef('XP %s { PHP %s & ZE %s } @ %s', xp::version(), phpversion(), zend_version(), php_uname());
Console::writeLine('Copyright (c) 2001-2013 the XP group');
foreach (ClassLoader::getLoaders() as $delegate) {
Console::writeLine($delegate->toString());
}
return 1;
}
示例10: _loadVersions
function _loadVersions()
{
$version = new JVersion();
$this->data['Versions']['Joomla!'] = $version->getLongVersion();
$this->data['Versions']['J!Dump'] = DUMP_VERSION;
$this->data['Versions']['PHP'] = phpversion();
$this->data['Versions']['Apache'] = function_exists('apache_get_version') ? apache_get_version() : 'unknown';
$this->data['Versions']['Zend Engine'] = zend_version();
}
示例11: randomBytes
function randomBytes($length = 16, $secure = true, $raw = true, $startEntropy = "", &$rounds = 0, &$drop = 0)
{
static $lastRandom = "";
$output = "";
$length = abs((int) $length);
$secureValue = "";
$rounds = 0;
$drop = 0;
while (!isset($output[$length - 1])) {
//some entropy, but works ^^
$weakEntropy = array(is_array($startEntropy) ? implode($startEntropy) : $startEntropy, serialize(stat(__FILE__)), __DIR__, PHP_OS, microtime(), (string) lcg_value(), (string) PHP_MAXPATHLEN, PHP_SAPI, (string) PHP_INT_MAX . "." . PHP_INT_SIZE, serialize($_SERVER), serialize(get_defined_constants()), get_current_user(), serialize(ini_get_all()), (string) memory_get_usage() . "." . memory_get_peak_usage(), php_uname(), phpversion(), extension_loaded("gmp") ? gmp_strval(gmp_random(4)) : microtime(), zend_version(), (string) getmypid(), (string) getmyuid(), (string) mt_rand(), (string) getmyinode(), (string) getmygid(), (string) rand(), function_exists("zend_thread_id") ? (string) zend_thread_id() : microtime(), var_export(@get_browser(), true), function_exists("getrusage") ? @implode(getrusage()) : microtime(), function_exists("sys_getloadavg") ? @implode(sys_getloadavg()) : microtime(), serialize(get_loaded_extensions()), sys_get_temp_dir(), (string) disk_free_space("."), (string) disk_total_space("."), uniqid(microtime(), true), file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : microtime());
shuffle($weakEntropy);
$value = hash("sha512", implode($weakEntropy), true);
$lastRandom .= $value;
foreach ($weakEntropy as $k => $c) {
//mixing entropy values with XOR and hash randomness extractor
$value ^= hash("sha256", $c . microtime() . $k, true) . hash("sha256", mt_rand() . microtime() . $k . $c, true);
$value ^= hash("sha512", (string) lcg_value() . $c . microtime() . $k, true);
}
unset($weakEntropy);
if ($secure === true) {
$strongEntropyValues = array(is_array($startEntropy) ? hash("sha512", $startEntropy[($rounds + $drop) % count($startEntropy)], true) : hash("sha512", $startEntropy, true), file_exists("/dev/urandom") ? fread(fopen("/dev/urandom", "rb"), 64) : str_repeat("", 64), (function_exists("openssl_random_pseudo_bytes") and version_compare(PHP_VERSION, "5.3.4", ">=")) ? openssl_random_pseudo_bytes(64) : str_repeat("", 64), function_exists("mcrypt_create_iv") ? mcrypt_create_iv(64, MCRYPT_DEV_URANDOM) : str_repeat("", 64), $value);
$strongEntropy = array_pop($strongEntropyValues);
foreach ($strongEntropyValues as $value) {
$strongEntropy = $strongEntropy ^ $value;
}
$value = "";
//Von Neumann randomness extractor, increases entropy
$bitcnt = 0;
for ($j = 0; $j < 64; ++$j) {
$a = ord($strongEntropy[$j]);
for ($i = 0; $i < 8; $i += 2) {
$b = ($a & 1 << $i) > 0 ? 1 : 0;
if ($b != (($a & 1 << $i + 1) > 0 ? 1 : 0)) {
$secureValue |= $b << $bitcnt;
if ($bitcnt == 7) {
$value .= chr($secureValue);
$secureValue = 0;
$bitcnt = 0;
} else {
++$bitcnt;
}
++$drop;
} else {
$drop += 2;
}
}
}
}
$output .= substr($value, 0, min($length - strlen($output), $length));
unset($value);
++$rounds;
}
$lastRandom = hash("sha512", $lastRandom, true);
return $raw === false ? bin2hex($output) : $output;
}
示例12: process
public function process()
{
$res = $this->request->server;
$res['phpversion'] = phpversion();
$res['zend_version'] = zend_version();
$res['sapi'] = php_sapi_name();
$res['handlers'] = Hm_Handler_Modules::dump();
$res['output'] = Hm_Output_Modules::dump();
$this->out('server_info', $res);
}
示例13: execute
public static function execute()
{
$result = array();
$db_time = OSCOM::callDB('Admin\\ServerInfo\\GetTime');
$db_uptime = OSCOM::callDB('Admin\\ServerInfo\\GetUptime');
$db_version = OSCOM::callDB('Admin\\ServerInfo\\GetVersion');
@(list($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5));
$data = array(array('key' => 'date', 'title' => OSCOM::getDef('field_server_date'), 'value' => DateTime::getShort(null, true)), array('key' => 'system', 'title' => OSCOM::getDef('field_server_operating_system'), 'value' => $system . ' ' . $kernel), array('key' => 'host', 'title' => OSCOM::getDef('field_server_host'), 'value' => $host . ' (' . gethostbyname($host) . ')'), array('key' => 'uptime', 'title' => OSCOM::getDef('field_server_up_time'), 'value' => @exec('uptime')), array('key' => 'http_server', 'title' => OSCOM::getDef('field_http_server'), 'value' => $_SERVER['SERVER_SOFTWARE']), array('key' => 'php', 'title' => OSCOM::getDef('field_php_version'), 'value' => 'PHP v' . PHP_VERSION . ' / Zend v' . zend_version()), array('key' => 'db_server', 'title' => OSCOM::getDef('field_database_host'), 'value' => DB_SERVER . ' (' . gethostbyname(DB_SERVER) . ')'), array('key' => 'db_version', 'title' => OSCOM::getDef('field_database_version'), 'value' => $db_version), array('key' => 'db_date', 'title' => OSCOM::getDef('field_database_date'), 'value' => DateTime::getShort($db_time, true)), array('key' => 'db_uptime', 'title' => OSCOM::getDef('field_database_up_time'), 'value' => $db_uptime));
$result['entries'] = $data;
$result['total'] = count($data);
return $result;
}
示例14: index
function index()
{
// $this->output->cache(1440); // 캐시 되고 있는동안 common 작동 안함
// 계정의 사용량을 구함
$account_space = `du -sb`;
$account_space = substr($account_space, 0, strlen($account_space) - 3);
// DATA 폴더의 용량을 구함
$data_path = DATA_PATH;
$data_space = `du -sb {$data_path}`;
$data_space = substr($data_space, 0, strlen($data_space) - 8);
// GD 버젼
$gd_support = extension_loaded('gd');
if ($gd_support) {
$gd_info = gd_info();
$gd_version = $gd_info['GD Version'];
} else {
$gd_version = 'GD가 설치되지 않음';
}
// MySQL 버전
$query = $this->db->query('select version() as ver');
$row = $query->row_array();
$db_version = $row['ver'];
/*
// http://kr2.php.net/manual/kr/function.mysql-stat.php
$mysql_stat = explode(' ', mysql_stat());
$a = explode(':', $mysql_stat[0]);
$db_date = $a[0] . ': ';
$days = floor($a[1]/86400);
if ($days)
$db_date .= $days . '일 ';
$hours = (floor($a[1]/3600)%24);
if ($hours)
$db_date .= $hours . '시간 ';
$min = (floor($a[1]/60)%60);
if ($min)
$db_date .= $min . '분';
$t = explode(':', $mysql_stat[2]);
$db_status = $mysql_stat[1].'<br/>';
$db_status .= $t[0].': '.number_format($t[1]).'<br/>';
$db_status .= $mysql_stat[3].'<br/>';
$db_status .= $mysql_stat[4].'<br/>';
$db_status .= $mysql_stat[5].'<br/>';
$db_status .= $mysql_stat[6].'<br/>';
$db_status .= $mysql_stat[7].'<br/>';
*/
$head = array('title' => '관리자 페이지');
$data = array('os_version' => php_uname('r'), 'ip_addr' => gethostbyname(trim(`hostname`)), 'account_space' => byte_format($account_space), 'data_space' => byte_format($data_space), 'code_space' => byte_format($account_space - $data_space), 'php_version' => phpversion(), 'zend_version' => zend_version(), 'gd_version' => $gd_version, 'max_filesize' => get_cfg_var('upload_max_filesize'), 'db_version' => $db_version, 'db_date' => '', 'db_status' => '');
widget::run('head', $head);
$this->load->view(ADM_F . '/main', $data);
widget::run('tail');
}
示例15: reverse
/**
* Computes a reversed diff.
*
* Example:
* <code>
* $diff = new Text_Diff($lines1, $lines2);
* $rev = $diff->reverse();
* </code>
*
* @return Text_Diff A Diff object representing the inverse of the
* original diff. Note that we purposely don't return a
* reference here, since this essentially is a clone()
* method.
*/
function reverse()
{
if (version_compare(zend_version(), '2', '>')) {
$rev = clone $this;
} else {
$rev = $this;
}
$rev->_edits = array();
foreach ($this->_edits as $edit) {
$rev->_edits[] = $edit->reverse();
}
return $rev;
}