| 65 |
|
|
| 66 |
function mamboCore () { |
function mamboCore () { |
| 67 |
global $adminside; |
global $adminside; |
| 68 |
|
error_reporting(0); |
| 69 |
$this->rootPath = dirname(__FILE__); |
$this->rootPath = dirname(__FILE__); |
| 70 |
$this->checkConfig(); |
$this->checkConfig(); |
| 71 |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
$this->Itemid = mosGetParam($_REQUEST, 'Itemid', 0); |
| 411 |
|
|
| 412 |
} |
} |
| 413 |
|
|
| 414 |
|
/* This is the new error handler to store errors in the database |
| 415 |
|
class mosErrorHandler { |
| 416 |
|
var $types = array ( |
| 417 |
|
E_STRICT => 'Strict check', |
| 418 |
|
E_USER_WARNING => 'User Warning', |
| 419 |
|
E_USER_NOTICE => 'User Notice', |
| 420 |
|
E_WARNING => 'Warning', |
| 421 |
|
E_NOTICE => 'Notice', |
| 422 |
|
E_CORE_WARNING => 'Core Warning', |
| 423 |
|
E_COMPILE_WARNING => 'Compile Warning', |
| 424 |
|
E_USER_ERROR => 'User Error', |
| 425 |
|
E_ERROR => 'Error', |
| 426 |
|
E_PARSE => 'Parse error', |
| 427 |
|
E_CORE_ERROR => 'Core Error', |
| 428 |
|
E_COMPILE_ERROR => 'Compile Error' |
| 429 |
|
); |
| 430 |
|
|
| 431 |
|
function mosErrorHandler () { |
| 432 |
|
set_error_handler(array(&$this, 'handler')); |
| 433 |
|
} |
| 434 |
|
|
| 435 |
|
function handler ($errno, $errstr, $errfile, $errline, $errcontext) { |
| 436 |
|
if ($errno = E_STRICT) return; |
| 437 |
|
$string = $this->types[$errno].': '.$errstr.' in '.$errfile.' at '.$errline; |
| 438 |
|
$database = mamboDatabase::getInstance(); |
| 439 |
|
if (eregi('^(sql)$', $errstr)) { |
| 440 |
|
$extra = $database->getErrorMsg(); |
| 441 |
|
} |
| 442 |
|
if (function_exists('debug_backtrace')) { |
| 443 |
|
foreach(debug_backtrace() as $back) { |
| 444 |
|
if (@$back['file']) { |
| 445 |
|
$extra .= "\n".$back['file'].':'.$back['line']; |
| 446 |
|
} |
| 447 |
|
} |
| 448 |
|
} |
| 449 |
|
$database->setQuery("DELETE FROM #__errors WHERE file=$errfile AND line=$errline AND number=$errno"); |
| 450 |
|
$database->query(); |
| 451 |
|
$database->setQuery("INSERT INTO #__errors VALUES (0, $errno, '$errfile', $errline, '$string', '$extra')"); |
| 452 |
|
$database->query(); |
| 453 |
|
} |
| 454 |
|
} |
| 455 |
|
*/ |
| 456 |
|
|
| 457 |
if (!isset($adminside)) $adminside = 0; |
if (!isset($adminside)) $adminside = 0; |
| 458 |
if (!isset($indextype)) $indextype = 1; |
if (!isset($indextype)) $indextype = 1; |
| 459 |
|
|
| 461 |
$configuration->handleGlobals(); |
$configuration->handleGlobals(); |
| 462 |
|
|
| 463 |
require_once ($configuration->rootPath().'/includes/database.php'); |
require_once ($configuration->rootPath().'/includes/database.php'); |
| 464 |
|
//new mosErrorHandler(); |
| 465 |
|
|
| 466 |
/** |
/** |
| 467 |
* Mambo basic error object |
* Mambo basic error object |
| 843 |
$ret = true; |
$ret = true; |
| 844 |
if (is_dir($path)) { |
if (is_dir($path)) { |
| 845 |
$topdir =& new mosDirectory($path); |
$topdir =& new mosDirectory($path); |
| 846 |
$files =& $topdir->listFiles ('', 'file', true); |
$files =& $topdir->listFiles ('', 'file', true, true); |
| 847 |
$dirs =& $topdir->listFiles ('', 'dir', true); |
$dirs =& $topdir->listFiles ('', 'dir', true, true); |
| 848 |
} |
} |
| 849 |
else { |
else { |
| 850 |
$files = array($path); |
$files = array($path); |