Exemple #1
0
 /**
  * Legacy admin bootstrap
  */
 protected function _initNewscoop()
 {
     global $ADMIN, $g_user, $prefix, $Campsite;
     defined('WWW_DIR') || define('WWW_DIR', realpath(APPLICATION_PATH . '/../'));
     defined('LIBS_DIR') || define('LIBS_DIR', WWW_DIR . '/admin-files/libs');
     $GLOBALS['g_campsiteDir'] = WWW_DIR;
     require_once $GLOBALS['g_campsiteDir'] . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'campsite_constants.php';
     require_once CS_PATH_CONFIG . DIR_SEP . 'install_conf.php';
     // goes to install process if configuration files does not exist yet
     if (!file_exists(CS_PATH_CONFIG . DIR_SEP . 'configuration.php') || !file_exists(CS_PATH_CONFIG . DIR_SEP . 'database_conf.php')) {
         header('Location: ' . $Campsite['SUBDIR'] . '/install/');
         exit;
     }
     require_once CS_PATH_CONFIG . DIR_SEP . 'database_conf.php';
     require_once CS_PATH_SITE . DIR_SEP . 'include' . DIR_SEP . 'campsite_init.php';
     require_once CS_PATH_SITE . DIR_SEP . 'classes' . DIR_SEP . 'CampTemplateCache.php';
     // detect extended login/logout files
     $prefix = file_exists(CS_PATH_SITE . DIR_SEP . 'admin-files' . DIR_SEP . 'ext_login.php') ? '/ext_' : '/';
     require_once CS_PATH_SITE . '/admin-files/camp_html.php';
     require_once CS_PATH_CLASSES . DIR_SEP . 'SecurityToken.php';
     if (php_sapi_name() !== 'cli') {
         set_error_handler(function ($p_number, $p_string, $p_file, $p_line) {
             error_log(sprintf('Newscoop error: %s in %s:%d', $p_string, $p_file, $p_line));
             global $Campsite;
             require_once $Campsite['HTML_DIR'] . "/admin-files/bugreporter/bug_handler_main.php";
             camp_bug_handler_main($p_number, $p_string, $p_file, $p_line);
         }, error_reporting());
     }
     if (file_exists($Campsite['HTML_DIR'] . '/reset_cache')) {
         CampCache::singleton()->clear('user');
         unlink($GLOBALS['g_campsiteDir'] . '/reset_cache');
     }
 }
Exemple #2
0
 /**
  * Legacy admin bootstrap
  */
 protected function _initNewscoop()
 {
     global $ADMIN_DIR, $ADMIN, $g_user, $prefix, $Campsite;
     defined('WWW_DIR') || define('WWW_DIR', realpath(APPLICATION_PATH . '/../'));
     defined('LIBS_DIR') || define('LIBS_DIR', WWW_DIR . '/admin-files/libs');
     $GLOBALS['g_campsiteDir'] = WWW_DIR;
     require_once $GLOBALS['g_campsiteDir'] . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'campsite_constants.php';
     require_once CS_PATH_CONFIG . DIR_SEP . 'install_conf.php';
     // goes to install process if configuration files does not exist yet
     if (!file_exists(CS_PATH_CONFIG . DIR_SEP . 'configuration.php') || !file_exists(CS_PATH_CONFIG . DIR_SEP . 'database_conf.php')) {
         header('Location: ' . $Campsite['SUBDIR'] . '/install/');
         exit;
     }
     require_once CS_PATH_CONFIG . DIR_SEP . 'database_conf.php';
     require_once CS_PATH_SITE . DIR_SEP . 'include' . DIR_SEP . 'campsite_init.php';
     require_once CS_PATH_SITE . DIR_SEP . 'classes' . DIR_SEP . 'CampTemplateCache.php';
     // detect extended login/logout files
     $prefix = file_exists(CS_PATH_SITE . DIR_SEP . 'admin-files' . DIR_SEP . 'ext_login.php') ? '/ext_' : '/';
     require_once CS_PATH_SITE . DIR_SEP . $ADMIN_DIR . DIR_SEP . 'camp_html.php';
     require_once CS_PATH_CLASSES . DIR_SEP . 'SecurityToken.php';
     // load if possible before setting camp_report_bug error handler
     // to prevent error messages
     include_once 'HTML/QuickForm.php';
     include_once 'HTML/QuickForm/RuleRegistry.php';
     include_once 'HTML/QuickForm/group.php';
     if (!defined('IN_PHPUNIT') && !getenv('PLZSTOPTHISERRORHANDLERBIZNIS')) {
         set_error_handler(function ($p_number, $p_string, $p_file, $p_line) {
             if (($p_number & error_reporting()) === 0) {
                 return;
                 // respect php settings
             }
             global $ADMIN_DIR, $Campsite;
             require_once $Campsite['HTML_DIR'] . "/{$ADMIN_DIR}/bugreporter/bug_handler_main.php";
             camp_bug_handler_main($p_number, $p_string, $p_file, $p_line);
         }, E_ALL);
     }
     camp_load_translation_strings("api");
     $plugins = CampPlugin::GetEnabled(true);
     foreach ($plugins as $plugin) {
         camp_load_translation_strings("plugin_" . $plugin->getName());
     }
     // Load common translation strings
     camp_load_translation_strings('globals');
     require_once APPLICATION_PATH . "/../{$ADMIN_DIR}/init_content.php";
     if (file_exists($Campsite['HTML_DIR'] . '/reset_cache')) {
         CampCache::singleton()->clear('user');
         unlink($GLOBALS['g_campsiteDir'] . '/reset_cache');
     }
 }
Exemple #3
0
/**
 * Called for all Campsite errors.
 */
function camp_report_bug($p_number, $p_string, $p_file, $p_line)
{
    global $ADMIN_DIR, $Campsite;
    require_once($Campsite['HTML_DIR'] . "/$ADMIN_DIR/bugreporter/bug_handler_main.php");
    camp_bug_handler_main($p_number, $p_string, $p_file, $p_line);
} // fn camp_report_bug