Admin_Bootstrap::_initNewscoop PHP Метод

_initNewscoop() защищенный Метод

Legacy admin bootstrap
protected _initNewscoop ( )
    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');
        }
    }