Index: trunk/coverager/coverager.php
===================================================================
--- trunk/coverager/coverager.php	(revision 33)
+++ trunk/coverager/coverager.php	(revision 124)
@@ -1,6 +1,5 @@
 <?php
 
-error_reporting(E_ALL);
-define('REQUEST_TIME', time());
+include("./common.php");
 
 class Cycle
@@ -41,4 +40,9 @@
 	var $exclude_paths = array();
 	var $charset = 'UTF-8';
+	var $lang = 'en-us';
+	var $datadir = null;
+	var $datadir_len = null;
+	var $path = null;
+	var $outpath = null;
 
 	function XcacheCoverageViewer()
@@ -47,12 +51,12 @@
 
 		// copy config
-		foreach (array('charset', 'include_paths', 'exclude_paths', 'syntaxhiglight', 'usecache', 'datadir') as $k) {
-			if (isset($GLOBALS['usecache'])) {
-				$this->{$k} = $GLOBALS['usecache'];
+		foreach (array('charset', 'include_paths', 'exclude_paths', 'syntaxhiglight', 'usecache', 'datadir', 'lang') as $k) {
+			if (isset($GLOBALS[$k])) {
+				$this->{$k} = $GLOBALS[$k];
 			}
 		}
 
 		$this->datadir = preg_replace('!/$!', '', $this->datadir);
-		$this->datadir_len =  strlen($this->datadir);
+		$this->datadir_len = strlen($this->datadir);
 
 		$this->path = isset($_GET['path']) ? $_GET['path'] : '';
@@ -125,4 +129,5 @@
 		}
 
+		$xcache_version = XCACHE_VERSION;
 		include("coverager.tpl.php");
 	}
@@ -304,8 +309,4 @@
 }
 
-if (file_exists("config.php")) {
-	include("config.php");
-}
-
 $app = new XcacheCoverageViewer();
 $app->main();
