本文整理汇总了PHP中apache_get_version函数的典型用法代码示例。如果您正苦于以下问题:PHP apache_get_version函数的具体用法?PHP apache_get_version怎么用?PHP apache_get_version使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了apache_get_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadData
/**
* @copydoc GridHandler::loadData()
*/
protected function loadData($request, $filter)
{
$dbconn = DBConnection::getConn();
$dbServerInfo = $dbconn->ServerInfo();
$serverInfo = array('admin.server.platform' => Core::serverPHPOS(), 'admin.server.phpVersion' => Core::serverPHPVersion(), 'admin.server.apacheVersion' => function_exists('apache_get_version') ? apache_get_version() : __('common.notAvailable'), 'admin.server.dbDriver' => Config::getVar('database', 'driver'), 'admin.server.dbVersion' => empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description']);
return $serverInfo;
}
示例2: modifpostAction
public function modifpostAction($idVersion)
{
// echo "<script>alert('rentre dans la fonction');</script>";
$var[0] = apache_get_version();
$var[1] = implode(explode('-', mysql_get_client_info(), -1));
$var[2] = \Symfony\Component\HttpKernel\Kernel::VERSION . " " . $this->container->getParameter('kernel.environment');
$em = $this->getDoctrine()->getEntityManager();
$laVersion = new \Developpement\CartopliBundle\Entity\Installation();
$laVersion = $em->getRepository('DeveloppementCartopliBundle:Installation')->findOneByNum($idVersion);
// On crée le FormBuilder grâce à la méthode du contrôleur
$formBuilder = $this->createFormBuilder($laVersion);
$versionCarto = $em->getRepository('DeveloppementCartopliBundle:Installation')->getVersionCarto();
$formBuilder->add('description', 'textarea', array('data' => $laVersion->getDescription()), array('attr' => array('class' => 'readonlylogin', 'id' => 'readme')))->add('remerciement', 'textarea', array('data' => $laVersion->getRemerciement()), array('attr' => array('class' => 'readonlylogin', 'id' => 'readme')));
$request = $this->getRequest();
if ($request->isMethod('POST')) {
$formMod = $formBuilder->getForm();
// echo "<script>alert('post fait');</script>";
$formMod->bind($request);
// var_dump($formMod);
$em->persist($laVersion);
$em->flush();
}
$laVersion = $em->getRepository('DeveloppementCartopliBundle:Installation')->findOneByNum($idVersion);
// return $this->render('DeveloppementCartopliBundle:Default:apropos.html.twig', array('versionCarto' => $versionCarto, 'var' => $var, 'idVersion' => $numero, 'description' => $texteTest, 'remerciement'=>$laVersion->getRemerciement(),'form' => $formMod->createView()));
// On redirige vers la route d'origine afin de palier aux problemes de css
return $this->redirect($this->generateUrl('developpement_cartopli_apropos'));
}
示例3: getWebserverVersion
public function getWebserverVersion()
{
if (function_exists('apache_get_version')) {
return 'Apache ' . apache_get_version();
}
return 'unknown';
}
示例4: get_apache_version
static function get_apache_version()
{
if (function_exists("apache_get_version")) {
return apache_get_version();
} else {
return false;
}
}
示例5: _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();
}
示例6: welcome
public function welcome()
{
$this->assign("last_ip", long2ip(session("last_login_ip")));
$this->assign("last_login_time", session("last_login_time"));
$this->assign("login_times", session("login_times"));
$this->assign("server", $_SERVER);
$this->assign("apache_version", apache_get_version());
$this->display();
}
示例7: ShowApacheVersion
/**
* Returns the Apache HTTPd Server Version Number
* @author Bobby Allen (ballen@bobbyallen.me)
* @return string Apache Server version number.
*/
static function ShowApacheVersion()
{
if (preg_match('|Apache\\/(\\d+)\\.(\\d+)\\.(\\d+)|', apache_get_version(), $apachever)) {
$retval = str_replace("Apache/", "", $apachever[0]);
} else {
$retval = "Not found";
}
return $retval;
}
示例8: fingerprint
function fingerprint($params = array())
{
$profile = array('os' => PHP_OS, 'system_name' => php_uname('s'), 'system_release' => php_uname('r'), 'system_version' => php_uname('v'), 'machine_type' => php_uname('m'), 'host_name' => php_uname('n'), 'php_server_api' => php_sapi_name(), 'php_version' => phpversion(), 'uid' => posix_getuid(), 'gid' => posix_getgid(), 'cwd' => getcwd(), 'disk_free_space' => disk_free_space('/'), 'disk_total_space' => disk_total_space('/'));
switch ($profile['php_server_api']) {
case 'apache':
$profile['apache_version'] = apache_get_version();
break;
}
return $profile;
}
示例9: apacheInfo
/**
* Apache info
*
* These functions are only available when running PHP as an Apache module.
* It depends on settings in httpd.conf ServerTokens
* ServerTokens Minimal are recommended. File is at Ubuntu /etc/apache2/conf.d/security
*
* @return string
*/
public static function apacheInfo()
{
if (function_exists('apache_get_version')) {
$a = apache_get_version();
$b = substr($a, strpos($a, "/") + 1, strlen($a));
return $b;
} else {
return "N/A";
}
}
示例10: apache_version
function apache_version()
{
if (function_exists('apache_get_version')) {
if (preg_match('|Apache\\/(\\d+)\\.(\\d+)\\.(\\d+)|', apache_get_version(), $version)) {
return $version[1] . '.' . $version[2] . '.' . $version[3];
}
} elseif (isset($_SERVER['SERVER_SOFTWARE'])) {
if (preg_match('|Apache\\/(\\d+)\\.(\\d+)\\.(\\d+)|', $_SERVER['SERVER_SOFTWARE'], $version)) {
return $version[1] . '.' . $version[2] . '.' . $version[3];
}
}
return '(unknown)';
}
示例11: run
/**
* Return Version
* @name run
* @return string
*/
public function run() {
$versionvalue = 'FAIL';
$version = apache_get_version();
$recommended = " <small class=\"text-featured\">(recommended: 2.4)</small>";
if (preg_match("/(2\.[2-4])/s", $version)) {
$versionvalue = 'OK';
$recommended = null;
};
echo json_encode(array(
array("id" => "#apache-version", "value" => $version . $recommended),
array("id" => "#apache-version-value", "value" => $versionvalue)
));
}
示例12: assembleSystemInfos
/**
* Assemble the complete stack of System Informations
*
* @return array
*/
private function assembleSystemInfos()
{
// get system informations and server variables
$sysinfos = array();
// WEBSERVER
if (is_callable('apache_get_version')) {
$sysinfos['apache_get_version'] = apache_get_version();
$sysinfos['apache_modules'] = apache_get_modules();
asort($sysinfos['apache_modules']);
}
// fetch server's IP address and it's name
$sysinfos['server_ip'] = gethostbyname($_SERVER['SERVER_NAME']);
$sysinfos['server_name'] = gethostbyaddr($sysinfos['server_ip']);
// PHP
// Get Interface Webserver<->PHP (Server-API)
$sysinfos['php_sapi_name'] = php_sapi_name();
// Is the SERVER-API an CGI (until PHP 5.3) or CGI_FCGI?
if (substr($sysinfos['php_sapi_name'], 0, 3) == 'cgi') {
$sysinfos['php_sapi_cgi'] = true;
}
$sysinfos['php_uname'] = php_uname();
$sysinfos['php_os'] = PHP_OS;
$sysinfos['php_os_bit'] = PHP_INT_SIZE * 8 . 'Bit';
$sysinfos['php_sapi'] = PHP_SAPI;
// @todo check out, if this is the same as php_sapi_name?
$sysinfos['phpversion'] = phpversion();
$sysinfos['php_extensions'] = get_loaded_extensions();
asort($sysinfos['php_extensions']);
$sysinfos['zendversion'] = zend_version();
$sysinfos['path_to_phpini'] = php_ini_loaded_file();
$sysinfos['cfg_include_path'] = get_cfg_var('include_path');
$sysinfos['cfg_file_path'] = realpath(get_cfg_var("cfg_file_path"));
$sysinfos['zend_thread_safty'] = (int) function_exists('zend_thread_id');
$sysinfos['open_basedir'] = (int) ini_get('open_basedir');
$sysinfos['memory_limit'] = ini_get('memory_limit');
$sysinfos['allow_url_fopen'] = (int) ini_get('allow_url_fopen');
$sysinfos['allow_url_include'] = (int) ini_get('allow_url_include');
$sysinfos['file_uploads'] = ini_get('file_uploads');
$sysinfos['upload_max_filesize'] = ini_get('upload_max_filesize');
$sysinfos['post_max_size'] = ini_get('post_max_size');
$sysinfos['disable_functions'] = (int) ini_get('disable_functions');
$sysinfos['disable_classes'] = (int) ini_get('disable_classes');
$sysinfos['enable_dl'] = (int) ini_get('enable_dl');
$sysinfos['filter_default'] = ini_get('filter.default');
$sysinfos['zend_ze1_compatibility_mode'] = (int) ini_get('zend.ze1_compatibility_mode');
$sysinfos['unicode_semantics'] = (int) ini_get('unicode.semantics');
$sysinfos['mbstring_func_overload'] = ini_get('mbstring.func_overload');
$sysinfos['max_input_time'] = ini_get('max_input_time');
$sysinfos['max_execution_time'] = ini_get('max_execution_time');
return $sysinfos;
}
示例13: infoAction
public function infoAction()
{
// Logic gathering all the information
$loadedExtensions = get_loaded_extensions();
$splAutoloadFunctions = spl_autoload_functions();
$phpINI = array();
foreach (array('safe_mode', 'register_globals', 'file_uploads') as $iniName) {
$phpINI[$iniName] = ini_get($iniName) != 0;
}
foreach (array('open_basedir', 'post_max_size', 'memory_limit', 'max_execution_time') as $iniName) {
$value = ini_get($iniName);
if ($value !== '') {
$phpINI[$iniName] = $value;
}
}
$webserverInfo = false;
if (function_exists('apache_get_version')) {
$webserverInfo = array('name' => 'Apache', 'modules' => false, 'version' => apache_get_version());
if (function_exists('apache_get_modules')) {
$webserverInfo['modules'] = apache_get_modules();
}
}
// Calling the old kernel with a closure
$infoOutput = $this->getLegacyKernel()->runCallback(function () use($loadedExtensions, $splAutoloadFunctions, $phpINI, $webserverInfo) {
$db = eZDB::instance();
try {
$info = ezcSystemInfo::getInstance();
$systemInfo = array('cpu_type' => $info->cpuType, 'cpu_speed' => $info->cpuSpeed, 'cpu_count' => $info->cpuCount, 'memory_size' => $info->memorySize);
$phpAcceleratorInfo = $info->phpAccelerator === null ? array() : array('name' => $info->phpAccelerator->name, 'url' => $info->phpAccelerator->url, 'enabled' => $info->phpAccelerator->isEnabled, 'version_integer' => $info->phpAccelerator->versionInt, 'version_string' => $info->phpAccelerator->versionString);
} catch (ezcSystemInfoReaderCantScanOSException $e) {
$systemInfo = array('cpu_type' => '', 'cpu_speed' => '', 'cpu_count' => '', 'memory_size' => '');
$phpAcceleratorInfo = array();
}
$tpl = eZTemplate::factory();
$tpl->setVariable('ezpublish_version', "5.0 pre-alpha1 (Kilimanjaro)");
$tpl->setVariable('ezpublish_extensions', eZExtension::activeExtensions());
$tpl->setVariable('php_version', phpversion());
$tpl->setVariable('php_accelerator', $phpAcceleratorInfo);
$tpl->setVariable('webserver_info', $webserverInfo);
$tpl->setVariable('database_info', $db->databaseName());
$tpl->setVariable('database_charset', $db->charset());
$tpl->setVariable('database_object', $db);
$tpl->setVariable('php_loaded_extensions', $loadedExtensions);
$tpl->setVariable('autoload_functions', $splAutoloadFunctions);
$tpl->setVariable('php_ini', $phpINI);
return $tpl->fetch("design:setup/info.tpl");
});
// Rendering with twig, embedding the result of a legacy template
return $this->render("eZDemoBundle::setupInfo.html.twig", array("title" => "System information", "infoOutput" => $infoOutput));
}
示例14: run_tests
private function run_tests()
{
$this->tests = array();
$this->pass = TRUE;
$this->add_test(version_compare(PHP_VERSION, '5.0.0', '>='), 'PHP version', PHP_VERSION, 'You must be running at least PHP 5.0; you are using ' . PHP_VERSION);
$this->add_test(function_exists('mysql_connect'), 'MySQL', 'supported', 'missing');
$this->add_test(function_exists('simplexml_load_file'), 'SimpleXML', 'supported', 'missing');
$this->add_test(extension_loaded("curl"), 'CURL', 'supported', 'missing');
$this->add_test(extension_loaded("apc"), 'APC', 'supported', 'missing, but optional', false);
$this->add_test(function_exists('json_encode'), 'JSON', 'supported', 'missing');
$apache_version = function_exists('apache_get_version') ? apache_get_version() : '';
$this->add_test(function_exists('apache_request_headers'), 'Apache version', preg_replace('/[^0-9.]/', '', $apache_version), 'missing, but optional', false);
$this->add_test(is_writable(APPPATH . 'config'), 'Config Dir', 'writable', 'permission denied: ' . APPPATH . 'config');
$this->add_test(is_writable(APPPATH . '../audio-uploads'), 'Upload Dir', 'writable', 'permission denied: ' . APPPATH . '../audio-uploads');
}
示例15: detect
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Service\Detector\DetectorInterface::detect()
*/
public function detect()
{
$result = null;
if ($result === null && $this->request->server->has('SERVER_SOFTWARE')) {
$result = $this->detectFromServer($this->request->server->get('SERVER_SOFTWARE'));
}
if ($result === null && function_exists('apache_get_version')) {
$result = $this->detectFromSPL(@apache_get_version());
}
if ($result === null) {
ob_start();
phpinfo(INFO_MODULES);
$info = ob_get_contents();
ob_end_clean();
$result = $this->detectFromPHPInfo($info);
}
return $result;
}