Bug Bug with xCache

Status
Not open for further replies.

furnival

Customer
I have VBOptimise installed with xCache on my server. As is nromal with xCache I have the resources admin web page for xCache set up too, to manage the cache and check everything is going OK. Because it is possible to clear the opcode cache from this xCache admin page it is a good idea for it to be security protected and xCache makes it easy to do that from a setting within its INI file (protecting the directory with .htpasswd does not work).

However I have a serious problem with this mod and xCache: when the password feature is enabled on the xCache admin directory the Advanced post thanks / like buttons do not work. When they are pressed they bring up a pop up window to authenticate for access to the xCache admin directory. So the only way I can have xCache on my forum with this mod is to turn off password protection on the XCache admin directory, which is a security risk.
 
This is not a bug. You should not be using the admin authentication feature in XCache, as it serves absolutely no purpose unless you are leaving the "xcache-admin" tool in a publicly accessible directory and do not protect it manually via .htaccess authentication.

Use this plugin on admin_index_main3 to see basic XCache stats in your vB AdminCP:
PHP:
if (function_exists('xcache_count'))
{
	$phpCacheCount = xcache_count(XC_TYPE_PHP);
	$varCacheCount = xcache_count(XC_TYPE_VAR);

	$stats = array();

	for ($i = 0; $i < $phpCacheCount; $i ++) {
		$data = xcache_info(XC_TYPE_PHP, $i);
		$data['type'] = XC_TYPE_PHP;
		$data['cache_name'] = "php#$i";
		$data['cacheid'] = $i;

		$stats['File Cache #' . $i] = array(
			'Cached Files' 				=> vb_number_format($data['cached']) . ' (' . vb_number_format($data['size'], 2, true) . ' Total, ' . vb_number_format($data['avail'], 2, true) . ' Available)',
			'Hits' 							=> vb_number_format($phpCache['hits']),
			'Misses' 						=> vb_number_format($phpCache['misses']),
			'Cache full count' 				=> vb_number_format($phpCache['ooms'])
		);
	}

	for ($i = 0; $i < $varCacheCount; $i ++) {
		$data = xcache_info(XC_TYPE_VAR, $i);
		$data['type'] = XC_TYPE_VAR;
		$data['cache_name'] = "var#$i";
		$data['cacheid'] = $i;

		$stats['Variable Cache #' . $i] = array(
			'Cached Variables' 				=> vb_number_format($data['cached']) . ' (' . vb_number_format($data['size'], 2, true) . ' Total, ' . vb_number_format($data['avail'], 2, true) . ' Available)',
			'Hits' 							=> vb_number_format($data['hits']),
			'Misses' 						=> vb_number_format($data['misses']),
			'Cache full count' 				=> vb_number_format($data['ooms'])
		);
	}

	print_table_start();
	print_table_header('XCache Cache Info', 2);
	foreach ($stats as $title => $info)
	{
		print_description_row($title, false, 2, 'optiontitle');
		foreach ($info as $key => $val)
		{
			print_cells_row(array("<strong>$key</strong>", $val), 0, 0, -5, 'top', 0, 1);
		}	
	}
	print_table_footer(2, '', '', false);
}

Otherwise, you can rename the xcache-admin dir and move it in a subdirectory nobody would know about, such as your AdminCP directory, if you absolutely must have it publicly accessible.

I would recommend that you do not upload the xcache-admin utility.
 
Last edited:
Status
Not open for further replies.

Legacy Advanced Post Thanks / Like

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,033
Customer rating
5.00 star(s) 1 ratings
Back
Top