private function bootApp($script)
 {
     global $app, $pa_page_render_start;
     $pa_page_render_start = microtime(TRUE);
     /* timing */
     if (!defined("PA_DISABLE_BUFFERING")) {
         ob_start("pa_end_of_page_ob_filter");
     }
     PA::$config = new PA();
     PA::$project_dir = PA_PROJECT_PROJECT_DIR;
     PA::$core_dir = PA_PROJECT_CORE_DIR;
     $app = new CNBootStrap(PA_PROJECT_ROOT_DIR, $this->current_route, $this->route_query_str);
     $GLOBALS['app'] = $app;
     // make $app object available in global scope
     $app->loadConfigFile(APPLICATION_CONFIG_FILE);
     if (PA::$config->pa_installed) {
         $app->detectDBSettings();
     }
     $app->autoLoadFiles($this->auto_load_list);
     $app->loadLanguageFiles();
     default_exception();
     // register default exception handler
     if (PA::$ssl_force_https_urls) {
         $this->routing_scheme = 'https';
     }
     if (PA::$ssl_security_on) {
         if ($this->dispatcher_scheme != $this->routing_scheme) {
             $this->restoreServerData();
             header("Location: " . $this->routing_scheme . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
             // "$path_pref/$file_name" . $path_info . $guery_str);
             exit;
         }
     }
     if (PA::$profiler) {
         register_shutdown_function("show_profiler_statistic");
     }
     PA::$path = PA_INSTALL_DIR;
     PA::$url = PA_BASE_URL;
     PA::$remote_ip = $app->remote_addr;
     if (PA::$config->pa_installed) {
         $app->detectNetwork();
         $app->getCurrentUser();
         if ($script != 'web/cnuser_login_index.php' && PA::$login_uid != SUPER_USER_ID && SITE_UNDER_MAINTAINENCE == 1) {
             $script = "web/cnmaintenance.php";
         }
     } else {
         $script = DEFAULT_INSTALL_SCRIPT;
     }
     ob_get_clean();
     return $script;
 }