本文整理汇总了PHP中phpinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP phpinfo函数的具体用法?PHP phpinfo怎么用?PHP phpinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpinfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: output
/**
*
*/
function output()
{
global $application;
ob_start();
phpinfo(1);
$content = ob_get_contents();
ob_end_clean();
$flag = true;
while ($flag) {
$pos = _ml_strpos($content, "\n");
$line = _ml_substr($content, 0, $pos);
$content = _ml_substr($content, $pos + 1);
if (_ml_strpos($line, "System")) {
$line = _ml_substr($line, 0, _ml_strrpos($line, "<"));
$line = _ml_substr($line, 0, _ml_strrpos($line, "<"));
$line = _ml_substr($line, _ml_strrpos($line, ">") + 1);
$flag = false;
}
}
$OS = $line;
$request = new Request();
$request->setView('PHPInfo');
$link = $request->getURL();
global $db_link;
$template_contents = array("ProductVersion" => PRODUCT_VERSION_NUMBER, "ProductVersionType" => PRODUCT_VERSION_TYPE, "ProductReleaseDate" => PRODUCT_VERSION_DATE, "CoreVersion" => CORE_VERSION, "ModulesList" => $this->outputModules(), "phpVersion" => PHP_VERSION, "MySQLVersion" => mysqli_get_server_info($db_link), "ServerOS" => $OS, "WebServerVersion" => $_SERVER["SERVER_SOFTWARE"], "PHPInfoLink" => $link);
$this->_Template_Contents = $template_contents;
$application->registerAttributes($this->_Template_Contents);
return modApiFunc('TmplFiller', 'fill', "tools/server_info/", "container.tpl.html", array());
}
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:32,代码来源:server_info_az.php
示例2: getPHPInfo
public static function getPHPInfo()
{
if (isset(self::$_aPHPInfo)) {
return self::$_aPHPInfo;
}
ob_start();
phpinfo(-1);
$_sOutput = preg_replace(array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms', '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#', "#[ \t]+#", '# #', '# +#', '# class=".*?"#', '%'%', '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>' . '<h1>PHP Version (.*?)</h1>(?:\\n+?)</td></tr>#', '#<h1><a href="(?:.*?)\\?=(.*?)">PHP Credits</a></h1>#', '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#', "# +#", '#<tr>#', '#</tr>#'), array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ', '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' . "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>', '<tr><td>PHP Credits Egg</td><td>$1</td></tr>', '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'), ob_get_clean());
$_aSections = explode('<h2>', strip_tags($_sOutput, '<h2><th><td>'));
unset($_aSections[0]);
$_aOutput = array();
foreach ($_aSections as $_sSection) {
$_iIndex = substr($_sSection, 0, strpos($_sSection, '</h2>'));
preg_match_all('#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', $_sSection, $_aAskApache, PREG_SET_ORDER);
foreach ($_aAskApache as $_aMatches) {
if (!isset($_aMatches[1], $_aMatches[2])) {
array_slice($_aMatches, 2);
continue;
}
$_aOutput[$_iIndex][$_aMatches[1]] = !isset($_aMatches[3]) || $_aMatches[2] == $_aMatches[3] ? $_aMatches[2] : array_slice($_aMatches, 2);
}
}
self::$_aPHPInfo = $_aOutput;
return self::$_aPHPInfo;
}
开发者ID:ashik968,项目名称:digiplot,代码行数:25,代码来源:AdminPageFramework_Utility_SystemInformation.php
示例3: ckeditor_parse_php_info
/**
* http://www.php.net/manual/en/function.phpinfo.php
* code at adspeed dot com
* 09-Dec-2005 11:31
* This function parses the phpinfo output to get details about a PHP module.
*/
function ckeditor_parse_php_info()
{
ob_start();
phpinfo(INFO_MODULES);
$s = ob_get_contents();
ob_end_clean();
$s = strip_tags($s, '<h2><th><td>');
$s = preg_replace('/<th[^>]*>([^<]+)<\\/th>/', "<info>\\1</info>", $s);
$s = preg_replace('/<td[^>]*>([^<]+)<\\/td>/', "<info>\\1</info>", $s);
$vTmp = preg_split('/(<h2>[^<]+<\\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
$vModules = array();
for ($i = 1; $i < count($vTmp); $i++) {
if (preg_match('/<h2>([^<]+)<\\/h2>/', $vTmp[$i], $vMat)) {
$vName = trim($vMat[1]);
$vTmp2 = explode("\n", $vTmp[$i + 1]);
foreach ($vTmp2 as $vOne) {
$vPat = '<info>([^<]+)<\\/info>';
$vPat3 = "/{$vPat}\\s*{$vPat}\\s*{$vPat}/";
$vPat2 = "/{$vPat}\\s*{$vPat}/";
if (preg_match($vPat3, $vOne, $vMat)) {
// 3cols
$vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]), trim($vMat[3]));
} elseif (preg_match($vPat2, $vOne, $vMat)) {
// 2cols
$vModules[$vName][trim($vMat[1])] = trim($vMat[2]);
}
}
}
}
return $vModules;
}
开发者ID:ckeditor-for-wordpress,项目名称:ckeditor-for-wordpress,代码行数:37,代码来源:overview.php
示例4: getPhpInfo
/**
* Method to get the PHP info
*
* @return string
*/
public function getPhpInfo()
{
if (!is_null($this->phpInfo)) {
return $this->phpInfo;
}
if (function_exists('phpinfo')) {
ob_start();
date_default_timezone_set('UTC');
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
$phpInfo = ob_get_contents();
ob_end_clean();
preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpInfo, $output);
$output = preg_replace('#<table[^>]*>#', '<table class="table table-striped">', $output[1][0]);
$output = preg_replace('#(\\w),(\\w)#', '\\1, \\2', $output);
$output = preg_replace('#<hr />#', '', $output);
$output = str_replace('<div class="center">', '', $output);
$output = preg_replace('#<tr class="h">(.*)<\\/tr>#', '<thead><tr class="h">$1</tr></thead><tbody>', $output);
$output = str_replace('</table>', '</tbody></table>', $output);
$output = str_replace('</div>', '', $output);
$this->phpInfo = $output;
} elseif (function_exists('phpversion')) {
$this->phpInfo = $this->translator->trans('mautic.sysinfo.phpinfo.phpversion', array('%phpversion%' => phpversion()));
} else {
$this->phpInfo = $this->translator->trans('mautic.sysinfo.phpinfo.missing');
}
return $this->phpInfo;
}
开发者ID:Yame-,项目名称:mautic,代码行数:32,代码来源:SysinfoModel.php
示例5: Image_Graph_gd_version
/**
* Check which version of GD is installed
* @return int 0 if GD isn't installed, 1 if GD 1.x is installed and 2 if GD 2.x is installed
*/
function Image_Graph_gd_version()
{
if (function_exists("gd_info")) {
$info = gd_info();
$version = $info['GD Version'];
} else {
ob_start();
phpinfo(8);
$php_info = ob_get_contents();
ob_end_clean();
if (ereg("<td[^>]*>GD Version *<\/td><td[^>]*>([^<]*)<\/td>", $php_info, $result)) {
$version = $result[1];
}
}
if ($version) {
//define("GD_VERSION", $version);
}
if (ereg("1\.[0-9]{1,2}", $version)) {
return 1;
}
elseif (ereg("2\.[0-9]{1,2}", $version)) {
return 2;
} else {
return 0;
}
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:33,代码来源:Common.php
示例6: compatibilityCheckPHPInfo
protected function compatibilityCheckPHPInfo()
{
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$info = array();
preg_match_all('{<tr><td class="e">(?>(.+?)</td>)<td class="v">(?>(.+?)</td>)</tr>}', $phpinfo, $matches);
foreach ($matches[1] as $key => $label) {
$info[trim(strtolower($label))] = trim(strtolower($matches[2][$key]));
}
preg_match_all('{<tr class="h"><th>(?>(.+?)</th>)<th>(?>(.+?)</th>)</tr>}', $phpinfo, $matches);
foreach ($matches[1] as $key => $label) {
$info[trim(strtolower($label))] = trim(strtolower($matches[2][$key]));
}
if (isset($info['server_software'])) {
if (strpos($info['server_software'], 'apache') === false) {
$this->err("Apache web server server software is required. You are running \"{$info['server_software']}\". Continue at your own risk, ProcessWire is not currently tested with any other server software.");
} else {
$this->li("Server Software: {$info['server_software']}");
}
} else {
$this->err("Unable to determine server software. It may be okay to continue, but note that ProcessWire is only developed for Apache at present.");
}
$tests = array('mysqli support', 'spl support', 'ctype functions', 'gd support', 'iconv support', 'hash support', 'json support', 'pcre (perl compatible regular expressions) support', 'session support');
foreach ($tests as $test) {
if (!isset($info[$test]) || $info[$test] != 'enabled') {
$this->err("Failed test for: {$test}");
} else {
$this->li("{$test}: OK");
}
}
}
开发者ID:nightsh,项目名称:ProcessWire,代码行数:33,代码来源:install.php
示例7: testGD
/**
* Test if the GD library is available
*
* @return array
*/
protected static function testGD()
{
$gd = array();
$output = '';
$gdVersion = null;
$gdInfo = null;
//$GDfuncList = get_extension_funcs('gd');
if (function_exists('gd_info')) {
$gdInfo = gd_info();
$gdVersion = $gdInfo['GD Version'];
} else {
ob_start();
@phpinfo(INFO_MODULES);
$output = ob_get_contents();
ob_end_clean();
$matches[1] = '';
if ($output !== '') {
if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s", $output, $matches)) {
$gdVersion = $matches[2];
} else {
return $gd;
}
}
}
if (function_exists('imagecreatetruecolor') && function_exists('imagecreatefromjpeg')) {
$gdVersion = isset($gdVersion) ? $gdVersion : 2;
$gd['gd2'] = "GD: " . $gdVersion;
} elseif (function_exists('imagecreatefromjpeg')) {
$gdVersion = isset($gdVersion) ? $gdVersion : 1;
$gd['gd1'] = "GD: " . $gdVersion;
}
return $gd;
}
开发者ID:glauberm,项目名称:cinevi,代码行数:38,代码来源:image.php
示例8: php_admin_info
function php_admin_info()
{
if (!current_user_can('manage_options')) {
wp_die(__('You do not have sufficient permissions to access this page.'));
}
// SET PLUGIN PATH REGARDLESS OF CONTAINING DIRECTORY
$plug_path = plugins_url('/', __FILE__);
$phpStyle = <<<PHPSTYLE
\t<style type="text/css">
\t#php-info-wrapper { padding: 20px; }
\t#php-info-wrapper table { padding: 1px; background: #ccc; border: 1px #777 solid; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; }
\t#php-info-wrapper td, th {padding:3px; background:#efefef; -webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;}
\t#php-info-wrapper tr.h img { display:none; }
\t#php-info-wrapper tr.h td{ background:none; }
\t#php-info-wrapper tr.h { text-align:right; height: 130px; background: url({$plug_path}php-logo.png) no-repeat 30px center; }
\t#php-info-wrapper tr.h h1{ padding-right:50px; }
\t</style>
PHPSTYLE;
echo $phpStyle;
echo '<div id="php-info-wrapper" class="wrap" >';
ob_start();
phpinfo();
$pinfo = ob_get_contents();
ob_end_clean();
$pinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo);
$pinfo = preg_replace('%^.*<title>(.*)</title>.*$%ms', '$1', $pinfo);
echo $pinfo;
echo '</div>';
}
开发者ID:RayViljoen,项目名称:WordPress-PHPInfo-Plugin,代码行数:29,代码来源:php-version.php
示例9: getICUDataVersion
/**
* @static
*
* @return string
*/
public static function getICUDataVersion()
{
if (defined('INTL_ICU_VERSION')) {
return INTL_ICU_VERSION;
}
ob_start();
phpinfo();
$content = ob_get_contents();
ob_end_clean();
$info = explode("\n", $content);
if ('cli' == php_sapi_name()) {
foreach ($info as $line) {
$results = array();
if (preg_match('/(ICU Data version|ICU version) => (.*)/', $line, $results)) {
return $results[2];
}
}
} else {
foreach ($info as $line) {
$results = array();
if (preg_match('/(ICU Data version).*/', $line, $results)) {
return trim(strtolower(strip_tags($results[0])), 'ICU Data version');
}
if (preg_match('/(ICU version).*/', $line, $results)) {
return trim(strtolower(strip_tags($results[0])), 'icu version');
}
}
}
return;
}
开发者ID:ingeniorweb,项目名称:symfo3cv,代码行数:35,代码来源:BaseHelper.php
示例10: run
public function run($command)
{
if (in_array($command, $this->getSynonyms())) {
$return = array();
$return[] = new Page($this->getHelp());
ob_start();
phpinfo(1);
$phpModules = ob_get_clean();
$return[] = new Page("<h3 id='PHP General'>PHP General</h3>" . $phpModules);
ob_start();
phpinfo(4);
$phpModules = ob_get_clean();
$return[] = new Page("<h3 id='PHP Configuration'>PHP Configuration</h3>" . $phpModules);
ob_start();
phpinfo(8);
$phpModules = ob_get_clean();
$return[] = new Page("<h3 id='PHP Modules'>PHP Modules</h3>" . $phpModules);
ob_start();
phpinfo(16);
$phpModules = ob_get_clean();
$return[] = new Page("<h3 id='PHP Environment'>PHP Environment</h3>" . $phpModules);
ob_start();
phpinfo(32);
$phpModules = ob_get_clean();
$return[] = new Page("<h3 id='PHP Variables'>PHP Variables</h3>" . $phpModules);
return $return;
}
return array();
}
开发者ID:stitch,项目名称:HackerBar,代码行数:29,代码来源:about.php
示例11: actionIndex
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
/*$arr = [5 => 0, 6 => 0, 7 => 0, 8 => 0];
$arr_test = [];
$num = array_search(min($arr),$arr);
var_dump($num);
exit();*/
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
/********************snoopy**********************/
/*$snoopy = new Snoopy();
header('Content-type:text/html;charset=gbk');
$snoopy->fetch('https://www.taobao.com');
print_r($snoopy->results);*/
/********************snoopy*************************/
//随机排序
/*$a = array(1,2,3,4,5);
shuffle($a);
for ($i=0; $i<count($a); ++$i)
echo $a[$i]." ";
shuffle($a);
echo "<br />";
for ($i=0; $i<count($a); ++$i) echo $a[$i]." ";*/
echo phpinfo();
exit;
$this->render('index');
}
开发者ID:kl0428,项目名称:urtime,代码行数:31,代码来源:SiteController.php
示例12: generateSummary
protected function generateSummary()
{
$suhosin_help = <<<FEED
<pre>
http://www.magentocommerce.com/wiki/groups/227/magento-compatible_suhosin_configuration
suggested in [.htaccess]
php_value suhosin.mail.protect 0
php_value suhosin.memory_limit 256M
php_value suhosin.post.max_vars 5000
php_value suhosin.post.max_value_length 500000
php_value suhosin.request.max_vars 5000
php_value suhosin.request.max_value_length 500000
<pre/>
FEED;
// Check if Suhosin is compiled into php and not a extension
// magento says to use these settings if using Suhosin...
//http://www.magentocommerce.com/wiki/groups/227/magento-compatible_suhosin_configuration
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$has_suhosin = false;
if (!extension_loaded('suhosin')) {
$this->addPass($this->__("PHP does not have problematic extension Suhosin."));
} else {
$this->addNotice($this->__("PHP has extension Suhosin."), $this->__("If Magento has issues, try these configuration ontop of the default values: %s", $suhosin_help));
}
if (strpos($phpinfo, "Suhosin Patch") === false) {
$this->addPass($this->__("Suhosin is not compiled directly into the PHP binary."));
} else {
$this->addNotice($this->__("Suhosin is compiled directly into the PHP binary."), $this->__("If Magento has issues, try these configuration ontop of the default values: %s", $suhosin_help));
}
}
开发者ID:rajarshc,项目名称:Rooja,代码行数:33,代码来源:Suhosin.php
示例13: index
function index()
{
$this->template->set('title', $this->language->get('heading_title'));
$view = $this->locator->create('template');
$view->set('button_list', $this->language->get('button_list'));
$view->set('button_insert', $this->language->get('button_insert'));
$view->set('button_update', $this->language->get('button_update'));
$view->set('button_delete', $this->language->get('button_delete'));
$view->set('button_save', $this->language->get('button_save'));
$view->set('button_cancel', $this->language->get('button_cancel'));
$view->set('button_print', $this->language->get('button_print'));
$view->set('heading_title', $this->language->get('heading_title'));
$view->set('heading_description', $this->language->get('heading_description'));
$view->set('text_php', $this->language->get('text_php'));
$view->set('text_db', $this->language->get('text_db'));
$view->set('text_db_server', $this->language->get('text_db_server'));
$view->set('text_db_name', $this->language->get('text_db_name'));
$view->set('php', phpversion());
$view->set('server', $_SERVER['SERVER_SOFTWARE']);
$view->set('db', 'MySQL ' . $this->modelServerInfo->get_server_info());
$view->set('db_server', DB_HOST);
$view->set('db_name', DB_NAME);
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$phpinfo = str_replace('border: 1px', '', $phpinfo);
preg_match('#<body>(.*?)</body>#is', $phpinfo, $regs);
$view->set('phpinfo', $regs[1]);
$this->template->set('content', $view->fetch('content/server_info.tpl'));
$this->template->set($this->module->fetch());
$this->response->set($this->template->fetch('layout.tpl'));
}
开发者ID:digitaldevelopers,项目名称:alegrocart,代码行数:33,代码来源:server_info.php
示例14: login
function login($username, $password)
{
global $_SESSION;
// Check for LDAP functions
if (!function_exists('ldap_connect')) {
$ex = 'LDAP support is not enabled in your PHP configuration.';
if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
ob_start();
phpinfo(INFO_GENERAL);
$phpinfo = ob_get_contents();
ob_end_clean();
preg_match('/Loaded Configuration File <\\/td><td.*?>(.*?)\\s*</', $phpinfo, $phpinfo);
$ex .= ' You probably just need to uncomment the line ;extension=php_ldap.dll in php.ini' . (count($phpinfo) > 1 ? ' (' . trim($phpinfo[1]) . ')' : '') . ' by removing the ";" and restart your web server.';
} else {
if (strtolower(substr(PHP_OS, 0, 5)) == 'Linux') {
$ex .= ' You probably need to install the php5-ldap (or similar depending on your distribution) package.';
}
}
throw new Exception($ex);
}
$auth = ldap_connect($this->config['host']);
if (!$auth) {
return false;
}
ldap_set_option($auth, LDAP_OPT_PROTOCOL_VERSION, 3);
if (!@ldap_bind($auth, sprintf($this->config['bind_dn'], $username), $password)) {
return false;
}
$_SESSION['valid'] = true;
$_SESSION['user'] = $username;
$_SESSION['admin'] = !$this->config['adminUser'] || $_SESSION['user'] == $this->config['adminUser'];
$_SESSION['authCheckHeartbeat'] = time();
}
开发者ID:enricowillemse,项目名称:prime_admin,代码行数:33,代码来源:LDAP.php
示例15: access_details
function access_details()
{
$access_details = array();
$access_details['domain'] = '';
$access_details['ip'] = '';
$access_details['directory'] = '';
$access_details['server_hostname'] = '';
$access_details['server_ip'] = '';
if (function_exists('phpinfo')) {
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
$list = strip_tags($phpinfo);
$access_details['domain'] = $this->scrape_phpinfo($list, 'HTTP_HOST');
$access_details['ip'] = $this->scrape_phpinfo($list, 'SERVER_ADDR');
$access_details['directory'] = $this->scrape_phpinfo($list, 'SCRIPT_FILENAME');
$access_details['server_hostname'] = $this->scrape_phpinfo($list, 'System');
$access_details['server_ip'] = @gethostbyname($access_details['server_hostname']);
}
$access_details['domain'] = $access_details['domain'] ? $access_details['domain'] : $_SERVER['HTTP_HOST'];
$access_details['ip'] = $access_details['ip'] ? $access_details['ip'] : $this->server_addr();
$access_details['directory'] = $access_details['directory'] ? $access_details['directory'] : $this->path_translated();
$access_details['server_hostname'] = $access_details['server_hostname'] ? $access_details['server_hostname'] : @gethostbyaddr($access_details['ip']);
$access_details['server_hostname'] = $access_details['server_hostname'] ? $access_details['server_hostname'] : 'Unknown';
$access_details['server_ip'] = $access_details['server_ip'] ? $access_details['server_ip'] : @gethostbyaddr($access_details['ip']);
$access_details['server_ip'] = $access_details['server_ip'] ? $access_details['server_ip'] : 'Unknown';
foreach ($access_details as $key => $value) {
$access_details[$key] = $access_details[$key] ? $access_details[$key] : 'Unknown';
}
if ($this->valid_for_product_tiers) {
$access_details['valid_for_product_tiers'] = $this->valid_for_product_tiers;
}
return $access_details;
}
开发者ID:empotix,项目名称:travelo,代码行数:35,代码来源:auth.php
示例16: actionPhpInfo
/**
* PHP info
*
* @return null
*/
public function actionPhpInfo()
{
craft()->config->maxPowerCaptain();
ob_start();
phpinfo(-1);
$phpInfo = ob_get_clean();
$phpInfo = preg_replace(array('#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms', '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#', "#[ \t]+#", '# #', '# +#', '# class=".*?"#', '%'%', '#<tr>(?:.*?)"src="(?:.*?)=(.*?)" alt="PHP Logo" /></a><h1>PHP Version (.*?)</h1>(?:\\n+?)</td></tr>#', '#<h1><a href="(?:.*?)\\?=(.*?)">PHP Credits</a></h1>#', '#<tr>(?:.*?)" src="(?:.*?)=(.*?)"(?:.*?)Zend Engine (.*?),(?:.*?)</tr>#', "# +#", '#<tr>#', '#</tr>#'), array('$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ', '<h2>PHP Configuration</h2>' . "\n" . '<tr><td>PHP Version</td><td>$2</td></tr>' . "\n" . '<tr><td>PHP Egg</td><td>$1</td></tr>', '<tr><td>PHP Credits Egg</td><td>$1</td></tr>', '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>', ' ', '%S%', '%E%'), $phpInfo);
$sections = explode('<h2>', strip_tags($phpInfo, '<h2><th><td>'));
unset($sections[0]);
$phpInfo = array();
foreach ($sections as $section) {
$heading = substr($section, 0, strpos($section, '</h2>'));
preg_match_all('#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', $section, $parts, PREG_SET_ORDER);
foreach ($parts as $row) {
if (!isset($row[2])) {
continue;
} else {
if (!isset($row[3]) || $row[2] == $row[3]) {
$value = $row[2];
} else {
$value = array_slice($row, 2);
}
}
$phpInfo[$heading][$row[1]] = $value;
}
}
$this->renderTemplate('utils/phpinfo', array('phpInfo' => $phpInfo));
}
开发者ID:kentonquatman,项目名称:portfolio,代码行数:33,代码来源:UtilsController.php
示例17: getPHPInfo
public function getPHPInfo()
{
ob_start();
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_ENVIRONMENT | INFO_VARIABLES);
$phpInfoOutput = ob_get_clean();
$phpInfoStr = '';
foreach ($this->phpInfoToArray($phpInfoOutput) as $catTitle => $catData) {
$phpInfoStr .= '<h3>' . $catTitle . '</h3>
<table>
<tbody>';
foreach ($catData as $key => $val) {
$phpInfoStr .= '<tr>
<th>' . $key . '</th>
<td>';
if (is_array($val) === true) {
$phpInfoStr .= '<ul>';
foreach ($val as $subKey => $subVal) {
$phpInfoStr .= '<li>' . $subKey . ': ' . $subVal . '</li>';
}
$phpInfoStr .= '</ul>';
} else {
$phpInfoStr .= $val;
}
$phpInfoStr .= '</td>
</tr>';
}
$phpInfoStr .= '</tbody></table>';
}
return $this->generatePage(array('siteTitle' => 'PHP info', 'phpinfo' => $phpInfoStr), 200);
}
开发者ID:TiMESPLiNTER,项目名称:meta-cms,代码行数:30,代码来源:GeneralController.php
示例18: php
/**
* This static function returns php informations
*
* @returns an array with php info
*/
function php()
{
// Get the general PHP info
ob_start();
phpinfo(INFO_GENERAL);
$phpInfo .= ob_get_contents();
ob_end_clean();
// Get the right part
$phpInfo = substr($phpInfo, strpos($phpInfo, '<tr>'));
$phpInfo = substr($phpInfo, 0, strpos($phpInfo, '</table>'));
// Strip unneeded things
$phpInfo = str_replace('<tr><td class="e">', '', $phpInfo);
$phpInfo = str_replace(' </td></tr>', '', $phpInfo);
$phpInfo = trim($phpInfo);
// Get the settings
$settings = array();
foreach (explode("\n", $phpInfo) as $line) {
$line = explode(' </td><td class="v">', $line);
if (isset($line[1])) {
$settings[strtolower(str_replace(' ', '_', $line[0]))] = $line[1];
} else {
$settings[strtolower(str_replace(' ', '_', $line[0]))] = '';
}
}
// export other values
$settings['version'] = phpversion();
$settings['modules'] = implode(get_loaded_extensions(), ', ');
$settings['os'] = PHP_OS;
$settings['includePath'] = $GLOBALS['YD_INCLUDE_PATH'];
return $settings;
}
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:36,代码来源:YDCMStatistics.php
示例19: __construct
function __construct()
{
parent::__construct();
$this->aType2ClassCSS = array(BX_DOL_AUDIT_FAIL => 'fail', BX_DOL_AUDIT_WARN => 'warn', BX_DOL_AUDIT_UNDEF => 'undef', BX_DOL_AUDIT_OK => 'ok');
$this->aType2Title = array(BX_DOL_AUDIT_FAIL => _t('_sys_audit_title_fail'), BX_DOL_AUDIT_WARN => _t('_sys_audit_title_warn'), BX_DOL_AUDIT_UNDEF => _t('_sys_audit_title_undef'), BX_DOL_AUDIT_OK => _t('_sys_audit_title_ok'));
$this->sMinPhpVer = '5.3.0';
$this->aPhpSettings = array('allow_url_fopen' => array('op' => '=', 'val' => true, 'type' => 'bool'), 'allow_url_include' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'magic_quotes_gpc' => array('op' => '=', 'val' => false, 'type' => 'bool', 'warn' => 1), 'memory_limit' => array('op' => '>=', 'val' => 128 * 1024 * 1024, 'type' => 'bytes', 'unlimited' => -1), 'post_max_size' => array('op' => '>=', 'val' => 2 * 1024 * 1024, 'type' => 'bytes', 'warn' => 1), 'upload_max_filesize' => array('op' => '>=', 'val' => 2 * 1024 * 1024, 'type' => 'bytes', 'warn' => 1), 'register_globals' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'safe_mode' => array('op' => '=', 'val' => false, 'type' => 'bool'), 'short_open_tag' => array('op' => '=', 'val' => true, 'type' => 'bool'), 'disable_functions' => array('op' => 'without', 'val' => 'shell_exec,eval,assert,phpinfo,getenv,ini_set,mail,fsockopen,chmod,parse_ini_file'), 'php module: mysql' => array('op' => 'module', 'val' => 'mysql'), 'php module: curl' => array('op' => 'module', 'val' => 'curl'), 'php module: gd' => array('op' => 'module', 'val' => 'gd'), 'php module: mbstring' => array('op' => 'module', 'val' => 'mbstring'), 'php module: json' => array('op' => 'module', 'val' => 'json'), 'php module: fileinfo' => array('op' => 'module', 'val' => 'fileinfo'), 'php module: zip' => array('op' => 'module', 'val' => 'zip'), 'php module: openssl' => array('op' => 'module', 'val' => 'openssl'), 'php module: exif' => array('op' => 'module', 'val' => 'exif'));
$this->sMinMysqlVer = '4.1.2';
$this->aMysqlOptimizationSettings = array('key_buffer_size' => array('op' => '>=', 'val' => 128 * 1024, 'type' => 'bytes'), 'query_cache_limit' => array('op' => '>=', 'val' => 1000000), 'query_cache_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'query_cache_type' => array('op' => 'strcasecmp', 'val' => 'on'), 'max_heap_table_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'tmp_table_size' => array('op' => '>=', 'val' => 16 * 1024 * 1024, 'type' => 'bytes'), 'thread_cache_size ' => array('op' => '>', 'val' => 0));
$this->aOptimizationSettings = array('DB cache' => array('enabled' => 'sys_db_cache_enable', 'cache_engine' => 'sys_db_cache_engine', 'check_accel' => true), 'Page blocks cache' => array('enabled' => 'sys_pb_cache_enable', 'cache_engine' => 'sys_pb_cache_engine', 'check_accel' => true), 'Member menu cache' => array('enabled' => 'always_on', 'cache_engine' => 'sys_mm_cache_engine', 'check_accel' => true), 'Templates Cache' => array('enabled' => 'sys_template_cache_enable', 'cache_engine' => 'sys_template_cache_engine', 'check_accel' => true), 'CSS files cache' => array('enabled' => 'sys_template_cache_css_enable', 'cache_engine' => '', 'check_accel' => false), 'JS files cache' => array('enabled' => 'sys_template_cache_js_enable', 'cache_engine' => '', 'check_accel' => false), 'Compression for CSS/JS cache' => array('enabled' => 'sys_template_cache_compress_enable', 'cache_engine' => '', 'check_accel' => false));
$this->aRequiredApacheModules = array('rewrite_module' => 'mod_rewrite');
if (isset($_GET['action'])) {
$sOutput = null;
switch ($_GET['action']) {
case 'audit_send_test_email':
$sOutput = $this->sendTestEmail();
break;
case 'phpinfo':
ob_start();
phpinfo();
$sOutput = ob_get_clean();
break;
case 'phpinfo_popup':
$sUrlSelf = bx_js_string($_SERVER['PHP_SELF'], BX_ESCAPE_STR_APOS);
$sUrlSelf = bx_append_url_params($sUrlSelf, array('action' => 'phpinfo'));
$sOutput = '<iframe width="640" height="480" src="' . $sUrlSelf . '"></iframe>';
break;
}
if ($sOutput) {
header('Content-type: text/html; charset=utf-8');
echo $sOutput;
exit;
}
}
}
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxDolStudioToolsAudit.php
示例20: phpinfoAction
/**
* Renders a PHP info page.
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function phpinfoAction()
{
ob_start();
phpinfo();
$response = new Response(ob_get_clean());
return $response;
}
开发者ID:emodric,项目名称:PlatformUIBundle,代码行数:12,代码来源:SystemInfoController.php
注:本文中的phpinfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论