Project

General

Profile

1
<?php
2
/**
3
 * Temporary class to detect invalid instancing
4
 *
5
 * @author wkl
6
 */
7
class database {
8

    
9

    
10
	public function  __construct() {
11

    
12
		$this->showError();
13
	}
14

    
15
	public function  __call($name, $arguments) {
16
		$this->showError();
17
	}
18
	private function showError() {
19
		
20
		$y = debug_backtrace();
21
		$msg  = '<div style="margin: 100px auto; width: 70%; background-color: #ffcccc; padding: 10px;">';
22
		$msg .= '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
23
		$msg .= '<p>Ouups...  there is a invalid statement found!!</p>';
24
		$msg .= '<p>In File: <b>'.$y[1]['file'].'</b> Line: <b>'.$y[1]['line'].'</b><br />';
25
		$msg .= 'tried to create an invalid <b>'.$y[1]['class'].'</b> - object</p>';
26
		$msg .= '<p>Please replace <span style="color:#dd0000; font-weight:bold;">';
27
		$msg .= '$database = new database();</span> by <span style="color:#00bb00; font-weight:bold;">';
28
		$msg .= '$database = WbDatabase::getInstance();</span></p>';
29
		$msg .= '<p>Also you can get information and help from the ';
30
		$msg .= '<a href="http://www.websitebaker.org/forum/index.php/board,2.0.html">WebsiteBaker Forum</a></p>';
31
		$msg .= '<hr />';
32
		$msg .= '<p style="color: #dd0000; font-weight: bold;">Runtime Error !!</p>';
33
		$msg .= '<p>Ouups...  hier wurde ein ung&uuml;ltiges Kommando gefunden!!</p>';
34
		$msg .= '<p>In der Datei: <b>'.$y[1]['file'].'</b> - Zeile: <b>'.$y[1]['line'].'</b><br />';
35
		$msg .= 'wurde versucht, ein ung&uuml;ltiges <b>'.$y[1]['class'].'</b> - Objekt zu erstellen.</p>';
36
		$msg .= '<p>Bitte ersetzen Sie <span style="color:#dd0000; font-weight:bold;">';
37
		$msg .= '$database = new database();</span> durch <span style="color:#00bb00; font-weight:bold;">';
38
		$msg .= '$database = WbDatabase::getInstance();</span></p>';
39
		$msg .= '<p>Auch k&ouml;nnen sie auch Informationen und Hilfe im ';
40
		$msg .= '<a href="http://www.websitebaker.org/forum/index.php/board,31.0.html">WebsiteBaker Forum</a> finden.</p>';
41
		$msg .= '</div>';
42
		die($msg);
43
		
44
	}
45

    
46
}
(28-28/39)