require CONS_PATH_SETTINGS . "settings.php"; # Database require CONS_PATH_INCLUDE . "dbo/cdbo.php"; require CONS_PATH_INCLUDE . "dbo/" . CONS_AFF_DATABASECONNECTOR . ".php"; # Core require CONS_PATH_SYSTEM . "coreVar.php"; require CONS_PATH_SYSTEM . "core.php"; # Create core version according to debug/developer mode (note: does NOT connect to database yet) # ab -n50 total mean: 17ms 16ms if (CONS_DEVELOPER || isset($_GET['debugmode'])) { require CONS_PATH_SYSTEM . "coreFull.php"; $cdbo = "CDBO_" . CONS_AFF_DATABASECONNECTOR; $core = new CPresciaFull(new $cdbo('', '', '', '', isset($_GET['debugmode'])), true); } else { $cdbo = "CDBO_" . CONS_AFF_DATABASECONNECTOR; $core = new CPrescia(new $cdbo('', '', '', '', false), false); } if (CONS_AFF_ERRORHANDLER) { // override PHP error messaging? (if true, will not display errors, but rather log them) function PresciaErrorHandler($errno, $errstr, $errfile, $errline) { global $core; if (error_reporting() === 0) { return; } // if the function had a "@" before it, then ignore it totally switch ($errno) { case E_USER_WARNING: case E_USER_NOTICE: case E_WARNING: case E_NOTICE:
require CONS_PATH_SETTINGS . "settings.php"; # Database require CONS_PATH_INCLUDE . "dbo/cdbo.php"; require CONS_PATH_INCLUDE . "dbo/" . CONS_AFF_DATABASECONNECTOR . ".php"; # Core require CONS_PATH_SYSTEM . "coreVar.php"; require CONS_PATH_SYSTEM . "core.php"; # Create core version according to debug/developer mode # ab -n50 total mean: 16ms if (CONS_DEVELOPER || isset($_GET['debugmode'])) { require CONS_PATH_SYSTEM . "coreFull.php"; $cdbo = "CDBO_" . CONS_AFF_DATABASECONNECTOR; $core = new CPresciaFull(new $cdbo('', '', '', '', isset($_GET['debugmode'])), true); } else { $cdbo = "CDBO_" . CONS_AFF_DATABASECONNECTOR; $core = new CPrescia(new $cdbo('', '', '', '', false), false); } if (CONS_AFF_ERRORHANDLER) { // override PHP error messaging? (if true, will not display errors, but rather log them) function PresciaErrorHandler($errno, $errstr, $errfile, $errline) { global $core; if (error_reporting() === 0) { return; } // if the function had a "@" before it, then ignore it totally switch ($errno) { case E_USER_WARNING: case E_USER_NOTICE: case E_WARNING: case E_NOTICE:
function addPlugin($script, $relateToModule = "", $renamePluginTo = "", $noRaise = false) { $r = parent::addPlugin($script, $relateToModule, $renamePluginTo, $noRaise); if (!isset($this->dimconfig['_pluginStarter' . $script]) || $this->dimconfig['_pluginStarter' . $script] != true) { // ad monitors form this script to the list $fileP = CONS_PATH_SYSTEM . "plugins/{$script}/monitor.xml"; $fileS = CONS_PATH_PAGES . $_SESSION['CODE'] . "/_config/monitor.xml"; if (is_file($fileP)) { // plugin has a monitor if (is_file($fileS)) { // site has a monitor $contentP = cReadFile($fileP); if (preg_match("@[^<]*(<[^>]*>).*@", $contentP, $e)) { // get first tag ($e[1]) // check if site's monitor has this tag $contentS = cReadFile($fileS); if (strpos($contentS, $e[1]) === false) { // it doesn't have, add $contentS .= "\n" . $contentP; } cWriteFile($fileS, $contentS); } } else { copy($fileP, $fileS); } } $this->dimconfig['_pluginStarter' . $script] = true; } return $r; }