Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1688)
+++ branches/2.8.x/CHANGELOG	(revision 1689)
@@ -11,7 +11,8 @@
 ! = Update/Change
 ===============================================================================
 
-
+08 May-2012 Build 1689 Werner v.d.Decken(DarkViper)
+# fixed Errorhandling for old class.database
 08 May-2012 Build 1688 Dietmar Woellbrink (Luisehahne)
 ! update upgrade-script first remove access files in an existing pages folder
   before rebuilding them 
Index: branches/2.8.x/wb/upgrade-script.php
===================================================================
--- branches/2.8.x/wb/upgrade-script.php	(revision 1688)
+++ branches/2.8.x/wb/upgrade-script.php	(revision 1689)
@@ -23,10 +23,10 @@
 $admin = new admin('Addons', 'modules', false, false);
 
 $oldVersion  = 'Version '.WB_VERSION;
-$oldVersion .= (defined('WB_SP') ? '.'.WB_SP : '');
+$oldVersion .= (defined('WB_SP') ? WB_SP : '');
 $oldRevision = (defined('WB_REVISION') ? ' Revision ['.WB_REVISION.'] ' : '') ;
 $newVersion  = 'Version '.VERSION;
-$newVersion .= (defined('SP') ? '.'.SP : '');
+$newVersion .= (defined('SP') ? SP : '');
 $newRevision = (defined('REVISION') ? ' Revision ['.REVISION.'] ' : '');
 
 // set addition settings if not exists, otherwise upgrade will be breaks
@@ -65,7 +65,8 @@
 			'[ADMIN]/pages/settings2.php',
 
 			'[FRAMEWORK]/class.msg_queue.php',
-			'[FRAMEWORK]/class.database.php',
+			'[FRAMEWORK]/class.logfile.php',
+//			'[FRAMEWORK]/class.database.php',
 
 		 );
 
@@ -453,7 +454,7 @@
 
 echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
 
-if(version_compare(WB_REVISION, REVISION, '<='))
+if(version_compare(WB_REVISION, REVISION, '<'))
 {
 	echo '<h3>Step '.(++$stepID).': Updating core tables</h3>';
 
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1688)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1689)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '1688');
+if(!defined('REVISION')) define('REVISION', '1689');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/class.logfile.php
===================================================================
--- branches/2.8.x/wb/framework/class.logfile.php	(revision 1688)
+++ branches/2.8.x/wb/framework/class.logfile.php	(nonexistent)
@@ -1,240 +0,0 @@
-<?php
-/**
- *
- * @category        event logging
- * @package         core
- * @author          Independend-Software-Team
- * @author          WebsiteBaker Project
- * @copyright       2009-2011, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
- * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.2
- * @requirements    PHP 5.2.2 and higher
- * @version         $Id$
- * @filesource		$HeadURL$
- * @lastmodified    $Date$
- * @description     definition of all core constants.
- */
-
-/**
- * Description of classlog
- *
- * @author wkl
- */
-class LogFile {
-
-	private $_fh;                  // file-handle for logfile
-	private $_log_path;            // path to logfile
-	private $_log_file;            // name of logfile
-	private $_error = false;       // store internal errors
-/*
- * class can not be instanciated standalone
- */
-	protected function __construct( $log_file )
-	{
-		$this->_log_file = $log_file;
-	}
-
-/*
- * open the logfile for append
- */
-	private function openLogFile()
-	{
-		$this->_fh = fopen($this->_log_path.$this->_log_file, 'ab');
-		return isset($this->_fh);
-	}
-/*
- * provide read-only properties
- */
-	public function __get($property)
-	{
-		switch(strtolower($property)):
-			case 'error':
-				return $this->_error;
-				break;
-			default:
-				return null;
-		endswitch;
-	}
-/*
- * flush and close logfile
- */
-	private function closeLogFile()
-	{
-		if( isset($this->_fh) )
-		{
-			fflush($this->_fh);
-			fclose($this->_fh);
-			unset($this->_fh);
-		}
-	}
-
-/*
- * @param  string $logdir: directory to place the logfile
- * @return bool: true if directory is valid and writeable
- * @description:
- */
-	public function setLogDir( $logdir )
-	{
-		$this->_error = false;
-		$retval = false;
-		if( ($logdir = realpath($logdir)) )
-		{
-			$logdir = rtrim(str_replace('\\', '/', $logdir), '/');
-			if( defined('WB_PATH') )
-			{
-				$sysroot = WB_PATH;
-			}
-			else
-			{
-				$script_filename = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']);
-				$script_name = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
-				$sysroot = str_replace($script_name, '', $script_filename);
-			}
-			if( stripos($logdir, $sysroot) === 0 )
-			{
-				if( is_writable($logdir))
-				{
-					if( file_exists($logdir.'/'.$this->_log_file) )
-					{
-						if( is_writable($logdir.'/'.$this->_log_file) )
-						{
-							$this->_log_path = $logdir.'/';
-							$retval = true;
-						}else
-						{
-							$this->_error = 'existing logfile is not writable! ['.$logdir.$this->_log_file.']';
-						}
-					}
-					else
-					{
-						$this->_log_path = $logdir.'/';
-						$retval = true;
-					}
-				}else
-				{
-					$this->_error = 'access denied for directory ['.$logdir.']';
-				}
-			}else
-			{
-				$this->_error = 'logdir [ '.$logdir.' ] points outside of DOCUMENT_ROOT [ '.$sysroot.' ]';
-			}
-		}else
-		{
-			$this->_error = 'logdir can not be resolved ['.$logdir.']';
-		}
-		return $retval;
-	}
-
-/*
- * @param string $line: preformatted message to write into the logfile
- * @return none: an error will throw a exception
- */
-	protected function writeRaw( $message )
-	{
-		array_unshift( $message, (defined($_SESSION['USER_ID'])?$_SESSION['USER_ID']:0) );
-		array_unshift( $message, (isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'#') );
-		array_unshift( $message, gmdate(DATE_W3C) );
-		if( isset($this->_log_path) ){
-			if($this->openLogFile())
-			{
-				if( fputcsv($this->_fh, $message, ',', '"') !== false )
-				{
-					$this->closeLogFile();
-				}
-				else
-				{
-					throw new Exception('unable to append line ['.$this->_log_path.$this->_log_file.']');
-				}
-			}
-			else
-			{
-				throw new Exception('unable to open logfile ['.$this->_log_path.$this->_log_file.']');
-			}
-		}else
-		{
-			throw new Exception('undefined path for logfile ['.$this->_log_file.']');
-		}
-	}
-
-} // end of class
-
-/*
- *  Errorlog handler
- */
-class ErrorLog extends LogFile{
-
-	private static $_instance;
-
-	protected function __construct()
-	{
-		parent::__construct('error.log');
-	}
-
-	private function __clone() {}
-
-    public static function handle()
-    {
-        if (!isset(self::$_instance)) {
-            $c = __CLASS__;
-            self::$_instance = new $c;
-        }
-        return self::$_instance;
-    }
-
-/*
- * @param string $message: message to write into the logfile
- * @param string $file: (optional) name of the file where the error occures
- * @param string $function: (optional) name of the function where the error occures
- * @param string $line: (optional) number of the line where the error occures
- * @return none: an error will throw a exception
- */
-	public function write( $message, $file = '#', $function = '#', $line = '#' )
-	{
-		if( !is_array($message) )
-		{
-			$message = array($file, $function, $line, $message);
-		}
-		self::handle()->writeRaw( $message );
-	}
-} // end of class
-
-/*
- *  Accesslog handler
- */
-class AccessLog extends LogFile{
-
-	private static $_instance;
-
-	protected function __construct()
-	{
-		parent::__construct('access.log');
-	}
-
-	private function __clone() {}
-
-    public static function handle()
-    {
-        if (!isset(self::$_instance)) {
-            $c = __CLASS__;
-            self::$_instance = new $c;
-        }
-        return self::$_instance;
-    }
-
-/*
- * @param string $message: message to write into the logfile
- * @return none: an error will throw a exception
- */
-	public function write( $message )
-	{
-		if( !is_array($message) )
-		{
-			$message = array($message);
-		}
-		self::handle()->writeRaw( $message );
-	}
-} // end of class
-
-
-?>

Property changes on: branches/2.8.x/wb/framework/class.logfile.php
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/framework/class.database
===================================================================
--- branches/2.8.x/wb/framework/class.database	(revision 1688)
+++ branches/2.8.x/wb/framework/class.database	(nonexistent)
@@ -1,31 +0,0 @@
-<?php
-/**
- * Temporary class to detect invalid instancing
- *
- * @author wkl
- */
-class database {
-
-
-	public function  __construct() {
-
-		$y = debug_backtrace();
-		echo '<div style="margin: 100px auto; width: 70%">';
-		echo '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
-		echo '<p>Ouups...  there is a invalid statement found!!</p>';
-		echo '<p>In File: <b>'.$y[0]['file'].'</b> Line: <b>'.$y[0]['line'].'</b><br />tried to create an invalid <b>'.$y[0]['class'].'</b> - object</p>';
-		echo '<p>Please contact the module author to solve this problem.</p>';
-		echo '<p>Also you can get information and help from the ';
-		echo '<a href="http://www.websitebaker2.org/forum/index.php/board,2.0.html">WebsiteBaker Forum</a></p>';
-		echo '<hr />';
-		echo '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
-		echo '<p>Ouups...  hier wurde ein ung&uuml;ltiges Kommando gefunden!!</p>';
-		echo '<p>In Datei: <b>'.$y[0]['file'].'</b> - Zeile: <b>'.$y[0]['line'].'</b><br />es wurde versucht, ein ung&uuml;ltiges <b>'.$y[0]['class'].'</b> - Objekt zu erstellen.</p>';
-		echo '<p>Bitte kontaktieren Sie den Modulautor um dieses Problem zu l&ouml;sen.</p>';
-		echo '<p>Ebenso k&ouml;nnen sie auch Informationen und Hilfe im ';
-		echo '<a href="http://www.websitebaker2.org/forum/index.php/board,31.0.html">WebsiteBaker Forum</a> finden.</p>';
-		echo '</div>';
-	}
-
-
-}
\ No newline at end of file
Index: branches/2.8.x/wb/framework/class.database.php
===================================================================
--- branches/2.8.x/wb/framework/class.database.php	(nonexistent)
+++ branches/2.8.x/wb/framework/class.database.php	(revision 1689)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Temporary class to detect invalid instancing
+ *
+ * @author wkl
+ */
+class database {
+
+
+	public function  __construct() {
+
+		$this->showError();
+	}
+
+	public function  __call($name, $arguments) {
+		$this->showError();
+	}
+	private function showError() {
+		
+		$y = debug_backtrace();
+		$msg  = '<div style="margin: 100px auto; width: 70%">';
+		$msg .= '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
+		$msg .= '<p>Ouups...  there is a invalid statement found!!</p>';
+		$msg .= '<p>In File: <b>'.$y[0]['file'].'</b> Line: <b>'.$y[0]['line'].'</b><br />tried to create an invalid <b>'.$y[0]['class'].'</b> - object</p>';
+		$msg .= '<p>Please contact the module author to solve this problem.</p>';
+		$msg .= '<p>Also you can get information and help from the ';
+		$msg .= '<a href="http://www.websitebaker2.org/forum/index.php/board,2.0.html">WebsiteBaker Forum</a></p>';
+		$msg .= '<hr />';
+		$msg .= '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
+		$msg .= '<p>Ouups...  hier wurde ein ung&uuml;ltiges Kommando gefunden!!</p>';
+		$msg .= '<p>In Datei: <b>'.$y[0]['file'].'</b> - Zeile: <b>'.$y[0]['line'].'</b><br />es wurde versucht, ein ung&uuml;ltiges <b>'.$y[0]['class'].'</b> - Objekt zu erstellen.</p>';
+		$msg .= '<p>Bitte kontaktieren Sie den Modulautor um dieses Problem zu l&ouml;sen.</p>';
+		$msg .= '<p>Ebenso k&ouml;nnen sie auch Informationen und Hilfe im ';
+		$msg .= '<a href="http://www.websitebaker2.org/forum/index.php/board,31.0.html">WebsiteBaker Forum</a> finden.</p>';
+		$msg .= '</div>';
+		die($msg);
+		
+	}
+
+}
\ No newline at end of file

Property changes on: branches/2.8.x/wb/framework/class.database.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/framework/LogfileDev.php
===================================================================
--- branches/2.8.x/wb/framework/LogfileDev.php	(nonexistent)
+++ branches/2.8.x/wb/framework/LogfileDev.php	(revision 1689)
@@ -0,0 +1,240 @@
+<?php
+/**
+ *
+ * @category        event logging
+ * @package         core
+ * @author          Independend-Software-Team
+ * @author          WebsiteBaker Project
+ * @copyright       2009-2011, Website Baker Org. e.V.
+ * @link			http://www.websitebaker2.org/
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @platform        WebsiteBaker 2.8.2
+ * @requirements    PHP 5.2.2 and higher
+ * @version         $Id$
+ * @filesource		$HeadURL$
+ * @lastmodified    $Date$
+ * @description     definition of all core constants.
+ */
+
+/**
+ * !!! This class is exclusive for developing purposes !!!!
+ *
+ * @author wkl
+ */
+class LogfileDev {
+
+	private $_fh;                  // file-handle for logfile
+	private $_log_path;            // path to logfile
+	private $_log_file;            // name of logfile
+	private $_error = false;       // store internal errors
+/*
+ * class can not be instanciated standalone
+ */
+	protected function __construct( $log_file )
+	{
+		$this->_log_file = $log_file;
+	}
+
+/*
+ * open the logfile for append
+ */
+	private function openLogFile()
+	{
+		$this->_fh = fopen($this->_log_path.$this->_log_file, 'ab');
+		return isset($this->_fh);
+	}
+/*
+ * provide read-only properties
+ */
+	public function __get($property)
+	{
+		switch(strtolower($property)):
+			case 'error':
+				return $this->_error;
+				break;
+			default:
+				return null;
+		endswitch;
+	}
+/*
+ * flush and close logfile
+ */
+	private function closeLogFile()
+	{
+		if( isset($this->_fh) )
+		{
+			fflush($this->_fh);
+			fclose($this->_fh);
+			unset($this->_fh);
+		}
+	}
+
+/*
+ * @param  string $logdir: directory to place the logfile
+ * @return bool: true if directory is valid and writeable
+ * @description:
+ */
+	public function setLogDir( $logdir )
+	{
+		$this->_error = false;
+		$retval = false;
+		if( ($logdir = realpath($logdir)) )
+		{
+			$logdir = rtrim(str_replace('\\', '/', $logdir), '/');
+			if( defined('WB_PATH') )
+			{
+				$sysroot = WB_PATH;
+			}
+			else
+			{
+				$script_filename = str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']);
+				$script_name = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
+				$sysroot = str_replace($script_name, '', $script_filename);
+			}
+			if( stripos($logdir, $sysroot) === 0 )
+			{
+				if( is_writable($logdir))
+				{
+					if( file_exists($logdir.'/'.$this->_log_file) )
+					{
+						if( is_writable($logdir.'/'.$this->_log_file) )
+						{
+							$this->_log_path = $logdir.'/';
+							$retval = true;
+						}else
+						{
+							$this->_error = 'existing logfile is not writable! ['.$logdir.$this->_log_file.']';
+						}
+					}
+					else
+					{
+						$this->_log_path = $logdir.'/';
+						$retval = true;
+					}
+				}else
+				{
+					$this->_error = 'access denied for directory ['.$logdir.']';
+				}
+			}else
+			{
+				$this->_error = 'logdir [ '.$logdir.' ] points outside of DOCUMENT_ROOT [ '.$sysroot.' ]';
+			}
+		}else
+		{
+			$this->_error = 'logdir can not be resolved ['.$logdir.']';
+		}
+		return $retval;
+	}
+
+/*
+ * @param string $line: preformatted message to write into the logfile
+ * @return none: an error will throw a exception
+ */
+	protected function writeRaw( $message )
+	{
+		array_unshift( $message, (defined($_SESSION['USER_ID'])?$_SESSION['USER_ID']:0) );
+		array_unshift( $message, (isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:'#') );
+		array_unshift( $message, gmdate(DATE_W3C) );
+		if( isset($this->_log_path) ){
+			if($this->openLogFile())
+			{
+				if( fputcsv($this->_fh, $message, ',', '"') !== false )
+				{
+					$this->closeLogFile();
+				}
+				else
+				{
+					throw new Exception('unable to append line ['.$this->_log_path.$this->_log_file.']');
+				}
+			}
+			else
+			{
+				throw new Exception('unable to open logfile ['.$this->_log_path.$this->_log_file.']');
+			}
+		}else
+		{
+			throw new Exception('undefined path for logfile ['.$this->_log_file.']');
+		}
+	}
+
+} // end of class
+
+/*
+ *  Errorlog handler
+ */
+class ErrorLog extends LogFile{
+
+	private static $_instance;
+
+	protected function __construct()
+	{
+		parent::__construct('error.log');
+	}
+
+	private function __clone() {}
+
+    public static function handle()
+    {
+        if (!isset(self::$_instance)) {
+            $c = __CLASS__;
+            self::$_instance = new $c;
+        }
+        return self::$_instance;
+    }
+
+/*
+ * @param string $message: message to write into the logfile
+ * @param string $file: (optional) name of the file where the error occures
+ * @param string $function: (optional) name of the function where the error occures
+ * @param string $line: (optional) number of the line where the error occures
+ * @return none: an error will throw a exception
+ */
+	public function write( $message, $file = '#', $function = '#', $line = '#' )
+	{
+		if( !is_array($message) )
+		{
+			$message = array($file, $function, $line, $message);
+		}
+		self::handle()->writeRaw( $message );
+	}
+} // end of class
+
+/*
+ *  Accesslog handler
+ */
+class AccessLog extends LogFile{
+
+	private static $_instance;
+
+	protected function __construct()
+	{
+		parent::__construct('access.log');
+	}
+
+	private function __clone() {}
+
+    public static function handle()
+    {
+        if (!isset(self::$_instance)) {
+            $c = __CLASS__;
+            self::$_instance = new $c;
+        }
+        return self::$_instance;
+    }
+
+/*
+ * @param string $message: message to write into the logfile
+ * @return none: an error will throw a exception
+ */
+	public function write( $message )
+	{
+		if( !is_array($message) )
+		{
+			$message = array($message);
+		}
+		self::handle()->writeRaw( $message );
+	}
+} // end of class
+
+
+?>

Property changes on: branches/2.8.x/wb/framework/LogfileDev.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/framework/WbAutoloader.php
===================================================================
--- branches/2.8.x/wb/framework/WbAutoloader.php	(revision 1688)
+++ branches/2.8.x/wb/framework/WbAutoloader.php	(revision 1689)
@@ -32,10 +32,15 @@
  */
 	static public function CoreAutoloader($sClassName)
 	{
-		$sClassName = preg_replace(self::$_aSearchpatterns, self::$_aReplacements, $sClassName);
-		$sFileName = dirname(dirname(__FILE__)).'/'.str_replace('_', '/', $sClassName).'.php';
-		if(is_file($sFileName = dirname(dirname(__FILE__)).'/'.str_replace('_', '/', $sClassName).'.php')) {
-			include($sFileName);
+		if($sClassName == 'database'){
+			$sFileName = dirname(__FILE__).'/class.database.php';
+			if(is_file($sFileName)) { include($sFileName); }
+		}else {
+			$sClassName = preg_replace(self::$_aSearchpatterns, self::$_aReplacements, $sClassName);
+			$sFileName = dirname(dirname(__FILE__)).'/'.str_replace('_', '/', $sClassName).'.php';
+			if(is_file($sFileName = dirname(dirname(__FILE__)).'/'.str_replace('_', '/', $sClassName).'.php')) {
+				include($sFileName);
+			}
 		}
 	}
 } // end class Autoloader
\ No newline at end of file
