Vergleich inc/functions_serverstats.php - 1.6.10 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: functions_serverstats.php 5297 2010-12-28 22:01:14Z Tomm $

 * $Id$

 */

function build_server_stats($is_install=1, $prev_version='', $current_version='', $charset='')
{
$info = array();

 */

function build_server_stats($is_install=1, $prev_version='', $current_version='', $charset='')
{
$info = array();

	



	// Is this an upgrade or an install?
if($is_install == 1)
{

	// Is this an upgrade or an install?
if($is_install == 1)
{

Zeile 22Zeile 22
	{
$info['is_install'] = 0;
}

	{
$info['is_install'] = 0;
}

	



	// If we are upgrading....
if($info['is_install'] == 0)
{
// What was the previous version?
$info['prev_version'] = $prev_version;
}

	// If we are upgrading....
if($info['is_install'] == 0)
{
// What was the previous version?
$info['prev_version'] = $prev_version;
}

	



	// What's our current version?
$info['current_version'] = $current_version;

	// What's our current version?
$info['current_version'] = $current_version;

	



	// What is our current charset?
$info['charset'] = $charset;

// Parse phpinfo into array
$phpinfo = parse_php_info();

	// What is our current charset?
$info['charset'] = $charset;

// Parse phpinfo into array
$phpinfo = parse_php_info();

	



	// PHP Version
$info['phpversion'] = phpversion();


	// PHP Version
$info['phpversion'] = phpversion();


Zeile 62Zeile 62
	{
$info['sqlite'] = $phpinfo['sqlite']['SQLite Library'];
}

	{
$info['sqlite'] = $phpinfo['sqlite']['SQLite Library'];
}

	



	// Iconv Library Extension Version
$info['iconvlib'] = 0;
if(array_key_exists('iconv', $phpinfo))

	// Iconv Library Extension Version
$info['iconvlib'] = 0;
if(array_key_exists('iconv', $phpinfo))

Zeile 85Zeile 85
	{
$info['cgimode'] = 1;
}

	{
$info['cgimode'] = 1;
}

	



	// Server Software
$info['server_software'] = $_SERVER['SERVER_SOFTWARE'];

	// Server Software
$info['server_software'] = $_SERVER['SERVER_SOFTWARE'];

	



	// Allow url fopen php.ini setting
$info['allow_url_fopen'] = 0;
if(ini_get('safe_mode') == 0 && ini_get('allow_url_fopen'))
{
$info['allow_url_fopen'] = 1;
}

	// Allow url fopen php.ini setting
$info['allow_url_fopen'] = 0;
if(ini_get('safe_mode') == 0 && ini_get('allow_url_fopen'))
{
$info['allow_url_fopen'] = 1;
}

	



	// Check classes, extensions, php info, functions, and php ini settings
$check = array(
'classes' => array(

	// Check classes, extensions, php info, functions, and php ini settings
$check = array(
'classes' => array(

Zeile 104Zeile 104
			'xmlwriter' => array('bitwise' => 4, 'title' => 'XMLWriter'),
'imagemagick' => array('bitwise' => 8, 'title' => 'Imagick'),
),

			'xmlwriter' => array('bitwise' => 4, 'title' => 'XMLWriter'),
'imagemagick' => array('bitwise' => 8, 'title' => 'Imagick'),
),

		



		'extensions' => array(
'zendopt' => array('bitwise' => 1, 'title' => 'Zend Optimizer'),
'xcache' => array('bitwise' => 2, 'title' => 'XCache'),

		'extensions' => array(
'zendopt' => array('bitwise' => 1, 'title' => 'Zend Optimizer'),
'xcache' => array('bitwise' => 2, 'title' => 'XCache'),

Zeile 117Zeile 117
			'pdo_oci' => array('bitwise' => 256, 'title' => 'pdo_oci'),
'pdo_odbc' => array('bitwise' => 512, 'title' => 'pdo_odbc'),
),

			'pdo_oci' => array('bitwise' => 256, 'title' => 'pdo_oci'),
'pdo_odbc' => array('bitwise' => 512, 'title' => 'pdo_odbc'),
),

		



		'phpinfo' => array(
'zlib' => array('bitwise' => 1, 'title' => 'zlib'),
'mbstring' => array('bitwise' => 2, 'title' => 'mbstring'),
'exif' => array('bitwise' => 4, 'title' => 'exif'),
'zlib' => array('bitwise' => 8, 'title' => 'zlib'),

		'phpinfo' => array(
'zlib' => array('bitwise' => 1, 'title' => 'zlib'),
'mbstring' => array('bitwise' => 2, 'title' => 'mbstring'),
'exif' => array('bitwise' => 4, 'title' => 'exif'),
'zlib' => array('bitwise' => 8, 'title' => 'zlib'),

			



		),

		),

		



		'functions' => array(
'sockets' => array('bitwise' => 1, 'title' => 'fsockopen'),
'mcrypt' => array('bitwise' => 2, 'title' => 'mcrypt_encrypt'),

		'functions' => array(
'sockets' => array('bitwise' => 1, 'title' => 'fsockopen'),
'mcrypt' => array('bitwise' => 2, 'title' => 'mcrypt_encrypt'),

Zeile 139Zeile 139
			'curl' => array('bitwise' => 512, 'title' => 'curl_init'),
'iconv' => array('bitwise' => 1024, 'title' => 'iconv'),
),

			'curl' => array('bitwise' => 512, 'title' => 'curl_init'),
'iconv' => array('bitwise' => 1024, 'title' => 'iconv'),
),

		



		'php_ini' => array(
'post_max_size' => 'post_max_size',
'upload_max_filesize' => 'upload_max_filesize',
'safe_mode' => 'safe_mode',
),
);

		'php_ini' => array(
'post_max_size' => 'post_max_size',
'upload_max_filesize' => 'upload_max_filesize',
'safe_mode' => 'safe_mode',
),
);

	



	foreach($check as $cat_name => $category)
{
foreach($category as $name => $what)

	foreach($check as $cat_name => $category)
{
foreach($category as $name => $what)

Zeile 190Zeile 190
			}
}
}

			}
}
}

	



	// Host URL & hostname
$info['hosturl'] = $info['hostname'] = "unknown/local";
if($_SERVER['HTTP_HOST'] == 'localhost')

	// Host URL & hostname
$info['hosturl'] = $info['hostname'] = "unknown/local";
if($_SERVER['HTTP_HOST'] == 'localhost')

Zeile 208Zeile 208
		if($hosting)
{
preg_match('#We believe \<a href\="http:\/\/www.whoishostingthis.com\/linkout\/\?t\=[0-9]&url\=?([^"]*)" (title="([^"]*)" )target\=\_blank\>([^<]*)\<\/a\>#ism', $hosting, $matches);

		if($hosting)
{
preg_match('#We believe \<a href\="http:\/\/www.whoishostingthis.com\/linkout\/\?t\=[0-9]&url\=?([^"]*)" (title="([^"]*)" )target\=\_blank\>([^<]*)\<\/a\>#ism', $hosting, $matches);

			



			$info['hosturl'] = "unknown/no-url";
if(isset($matches[1]) && strlen(trim($matches[1])) != 0 && strpos($matches[1], '.') !== false)
{

			$info['hosturl'] = "unknown/no-url";
if(isset($matches[1]) && strlen(trim($matches[1])) != 0 && strpos($matches[1], '.') !== false)
{

Zeile 246Zeile 246
	{
$info['useragent'] = $_SERVER['HTTP_USER_AGENT'];
}

	{
$info['useragent'] = $_SERVER['HTTP_USER_AGENT'];
}

	



	// We need a unique ID for the host so hash it to keep it private and send it over

	// We need a unique ID for the host so hash it to keep it private and send it over

	if($_SERVER['HTTP_HOST'] == "localhost")
{
$id = $_SERVER['HTTP_HOST'].time();
}
else
{
$id = $_SERVER['HTTP_HOST'];
}

	$id = $_SERVER['HTTP_HOST'].time();









if(function_exists('sha1'))
{


if(function_exists('sha1'))
{

Zeile 265Zeile 258
	{
$info['id'] = md5($id);
}

	{
$info['id'] = md5($id);
}

	



	$string = "";
$amp = "";
foreach($info as $key => $value)

	$string = "";
$amp = "";
foreach($info as $key => $value)

Zeile 306Zeile 299
	$phpinfo_html = preg_replace("#<td[^>]*>([^<]+)<\/td>#", "<info>$1</info>", $phpinfo_html);
$phpinfo_html = preg_split("#(<h2[^>]*>[^<]+<\/h2>)#", $phpinfo_html, -1, PREG_SPLIT_DELIM_CAPTURE);
$modules = array();

	$phpinfo_html = preg_replace("#<td[^>]*>([^<]+)<\/td>#", "<info>$1</info>", $phpinfo_html);
$phpinfo_html = preg_split("#(<h2[^>]*>[^<]+<\/h2>)#", $phpinfo_html, -1, PREG_SPLIT_DELIM_CAPTURE);
$modules = array();

	



	for($i=1; $i < count($phpinfo_html); $i++)
{
if(preg_match("#<h2[^>]*>([^<]+)<\/h2>#", $phpinfo_html[$i], $match))

	for($i=1; $i < count($phpinfo_html); $i++)
{
if(preg_match("#<h2[^>]*>([^<]+)<\/h2>#", $phpinfo_html[$i], $match))

Zeile 318Zeile 311
				$pat = '<info>([^<]+)<\/info>';
$pat3 = "/$pat\s*$pat\s*$pat/";
$pat2 = "/$pat\s*$pat/";

				$pat = '<info>([^<]+)<\/info>';
$pat3 = "/$pat\s*$pat\s*$pat/";
$pat2 = "/$pat\s*$pat/";

				



				// 3 columns
if(preg_match($pat3, $one, $match))
{

				// 3 columns
if(preg_match($pat3, $one, $match))
{