Index: trunk/htdocs/coverager/coverager.php
===================================================================
--- trunk/htdocs/coverager/coverager.php	(revision 1052)
+++ trunk/htdocs/coverager/coverager.php	(revision 1053)
@@ -2,39 +2,9 @@
 
 include("./common.php");
-
-class Cycle
-{
-	var $values;
-	var $i;
-	var $count;
-
-	function Cycle($v)
-	{
-		$this->values = func_get_args();
-		$this->i = -1;
-		$this->count = count($this->values);
-	}
-
-	function next()
-	{
-		$this->i = ($this->i + 1) % $this->count;
-		return $this->values[$this->i];
-	}
-
-	function cur()
-	{
-		return $this->values[$this->i];
-	}
-
-	function reset()
-	{
-		$this->i = -1;
-	}
-}
 
 class XcacheCoverageViewer
 {
-	var $syntaxhiglight = true;
-	var $usecache = false;
+	var $syntax_higlight = true;
+	var $use_cache = false;
 	var $include_paths = array();
 	var $exclude_paths = array();
@@ -50,8 +20,8 @@
 		$this->datadir = ini_get('xcache.coveragedump_directory');
 
-		// copy config
-		foreach (array('charset', 'include_paths', 'exclude_paths', 'syntaxhiglight', 'usecache', 'datadir', 'lang') as $k) {
-			if (isset($GLOBALS[$k])) {
-				$this->{$k} = $GLOBALS[$k];
+		global $config;
+		foreach (array('charset', 'include_paths', 'exclude_paths', 'syntax_higlight', 'use_cache', 'datadir', 'lang') as $k) {
+			if (isset($config[$k])) {
+				$this->{$k} = $config[$k];
 			}
 		}
@@ -79,5 +49,5 @@
 			$prefix_len = strlen($path) + 1;
 			$dirinfo = $this->loadDir($this->outpath);
-			if (!$this->usecache) {
+			if (!$this->use_cache) {
 				ksort($dirinfo['subdirs']);
 				ksort($dirinfo['files']);
@@ -104,5 +74,5 @@
 				}
 			}
-			if ($this->syntaxhiglight) {
+			if ($this->syntax_higlight) {
 				$source = implode('', $lines);
 				ob_start();
@@ -130,5 +100,5 @@
 		else if (!$this->datadir) {
 			$action = 'error';
-			$error  = 'require `ini:xcache.coveragedump_directory` or `config:$datadir` to be set';
+			$error  = 'require `xcache.coveragedump_directory` in ini or `$datadir` in config to be set';
 		}
 		else {
@@ -137,5 +107,5 @@
 		}
 
-		$xcache_version = defined('XCACHE_VERSION') ? XCACHE_VERSION : '';
+		global $config;
 		include("coverager.tpl.php");
 	}
@@ -143,5 +113,5 @@
 	function loadDir($outdir, $addtodo = null)
 	{
-		if ($this->usecache) {
+		if ($this->use_cache) {
 			$cachefile = $outdir . "/.pcovcache";
 			if (file_exists($cachefile)) {
@@ -210,5 +180,5 @@
 		}
 
-		if ($this->usecache) {
+		if ($this->use_cache) {
 			ksort($subdirs);
 			ksort($files);
@@ -223,5 +193,5 @@
 				);
 
-		if ($this->usecache) {
+		if ($this->use_cache) {
 			$fp = fopen($cachefile, "wb");
 			fwrite($fp, serialize($info));
@@ -233,5 +203,5 @@
 	function loadFile($file)
 	{
-		if ($this->usecache) {
+		if ($this->use_cache) {
 			$cachefile = $file . "cache";
 			if (file_exists($cachefile)) {
@@ -243,5 +213,5 @@
 		unset($info['cov']);
 
-		if ($this->usecache) {
+		if ($this->use_cache) {
 			$fp = fopen($cachefile, "wb");
 			fwrite($fp, serialize($info));
