Example #1
0
 function main($mode, $sub)
 {
     global $lang, $template, $language, $src_root_path, $phpEx;
     global $src_container, $cache, $src_log, $request, $src_config_php_file;
     switch ($sub) {
         case 'intro':
             $src_container->get('cache.driver')->purge();
             $this->page_title = $lang['SUB_INTRO'];
             $template->assign_vars(array('TITLE' => $lang['INSTALL_INTRO'], 'BODY' => $lang['INSTALL_INTRO_BODY'], 'L_SUBMIT' => $lang['NEXT_STEP'], 'S_LANG_SELECT' => '<select id="language" name="language">' . $this->p_master->inst_language_select($language) . '</select>', 'U_ACTION' => $this->p_master->module_url . "?mode={$mode}&amp;sub=requirements&amp;language={$language}"));
             break;
         case 'requirements':
             $this->check_server_requirements($mode, $sub);
             break;
         case 'database':
             $this->obtain_database_settings($mode, $sub);
             break;
         case 'administrator':
             $this->obtain_admin_settings($mode, $sub);
             break;
         case 'config_file':
             $this->create_config_file($mode, $sub);
             break;
         case 'advanced':
             $this->obtain_advanced_settings($mode, $sub);
             break;
         case 'create_table':
             $this->load_schema($mode, $sub);
             break;
         case 'final':
             // Enable super globals to prevent issues with the new \src\request\request object
             $request->enable_super_globals();
             // Create a normal container now
             $src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx);
             $src_container = $src_container_builder->get_container();
             // Sets the global variables
             $cache = $src_container->get('cache');
             $src_log = $src_container->get('log');
             $this->build_search_index($mode, $sub);
             $this->add_modules($mode, $sub);
             $this->add_language($mode, $sub);
             $this->add_bots($mode, $sub);
             $this->email_admin($mode, $sub);
             $this->disable_avatars_if_unwritable();
             $this->populate_migrations($src_container->get('ext.manager'), $src_container->get('migrator'));
             // Remove the lock file
             @unlink($src_root_path . 'cache/install_lock');
             break;
     }
     $this->tpl_name = 'install_install';
 }
Example #2
0
// In case $src_adm_relative_path is not set (in case of an update), use the default.
$src_adm_relative_path = isset($src_adm_relative_path) ? $src_adm_relative_path : 'adm/';
$src_admin_path = defined('src_ADMIN_PATH') ? src_ADMIN_PATH : $src_root_path . $src_adm_relative_path;
// Include files
require $src_root_path . 'includes/functions.' . $phpEx;
require $src_root_path . 'includes/functions_content.' . $phpEx;
include $src_root_path . 'includes/functions_compatibility.' . $phpEx;
require $src_root_path . 'includes/constants.' . $phpEx;
require $src_root_path . 'includes/utf/utf_tools.' . $phpEx;
// Set PHP error handler to ours
set_error_handler(defined('src_MSG_HANDLER') ? src_MSG_HANDLER : 'msg_handler');
$src_class_loader_ext = new \src\class_loader('\\', "{$src_root_path}ext/", $phpEx);
$src_class_loader_ext->register();
src_load_extensions_autoloaders($src_root_path);
// Set up container
$src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx);
$src_container = $src_container_builder->get_container();
$src_class_loader->set_cache($src_container->get('cache.driver'));
$src_class_loader_ext->set_cache($src_container->get('cache.driver'));
require $src_root_path . 'includes/compatibility_globals.' . $phpEx;
// Add own hook handler
require $src_root_path . 'includes/hooks/index.' . $phpEx;
$src_hook = new src_hook(array('exit_handler', 'src_user_session_handler', 'append_sid', array('template', 'display')));
$src_hook_finder = $src_container->get('hook_finder');
foreach ($src_hook_finder->find() as $hook) {
    @(include $src_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
}
/**
* Main event which is triggered on every page
*
* You can use this event to load function files and initiate objects
Example #3
0
    exit(1);
}
define('IN_src', true);
$src_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require $src_root_path . 'includes/startup.' . $phpEx;
require $src_root_path . 'src/class_loader.' . $phpEx;
$src_class_loader = new \src\class_loader('src\\', "{$src_root_path}src/", $phpEx);
$src_class_loader->register();
$src_config_php_file = new \src\config_php_file($src_root_path, $phpEx);
extract($src_config_php_file->get_all());
require $src_root_path . 'includes/constants.' . $phpEx;
require $src_root_path . 'includes/functions.' . $phpEx;
require $src_root_path . 'includes/functions_admin.' . $phpEx;
require $src_root_path . 'includes/utf/utf_tools.' . $phpEx;
$src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx);
$src_container_builder->set_dump_container(false);
$input = new ArgvInput();
if ($input->hasParameterOption(array('--safe-mode'))) {
    $src_container_builder->set_use_extensions(false);
    $src_container_builder->set_dump_container(false);
} else {
    $src_class_loader_ext = new \src\class_loader('\\', "{$src_root_path}ext/", $phpEx);
    $src_class_loader_ext->register();
    src_load_extensions_autoloaders($src_root_path);
}
$src_container = $src_container_builder->get_container();
$src_container->get('request')->enable_super_globals();
require $src_root_path . 'includes/compatibility_globals.' . $phpEx;
$user = $src_container->get('user');
$user->add_lang('acp/common');
Example #4
0
src_require_updated('includes/functions.' . $phpEx);
src_require_updated('includes/functions_content.' . $phpEx, true);
src_include_updated('includes/functions_admin.' . $phpEx);
src_include_updated('includes/utf/utf_normalizer.' . $phpEx);
src_include_updated('includes/utf/utf_tools.' . $phpEx);
src_require_updated('includes/functions_install.' . $phpEx);
// Setup class loader first
$src_class_loader_new = new \src\class_loader('src\\', "{$src_root_path}install/update/new/src/", $phpEx);
$src_class_loader_new->register();
$src_class_loader = new \src\class_loader('src\\', "{$src_root_path}src/", $phpEx);
$src_class_loader->register();
$src_class_loader_ext = new \src\class_loader('\\', "{$src_root_path}ext/", $phpEx);
$src_class_loader_ext->register();
// Set up container
$src_config_php_file = new \src\config_php_file($src_root_path, $phpEx);
$src_container_builder = new \src\di\container_builder($src_config_php_file, $src_root_path, $phpEx);
$src_container_builder->set_use_extensions(false);
$src_container_builder->set_dump_container(false);
$src_container_builder->set_use_custom_pass(false);
$src_container_builder->set_inject_config(false);
$src_container_builder->set_compile_container(false);
$other_config_path = $src_root_path . 'install/update/new/config/';
$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $src_root_path . 'config/';
$src_container_builder->set_config_path($config_path);
$src_container_builder->set_custom_parameters(array('core.root_path' => $src_root_path, 'core.adm_relative_path' => $src_adm_relative_path, 'core.php_ext' => $phpEx, 'core.table_prefix' => '', 'cache.driver.class' => 'src\\cache\\driver\\file'));
$src_container = $src_container_builder->get_container();
$src_container->register('dbal.conn.driver')->setSynthetic(true);
$src_container->compile();
$src_class_loader->set_cache($src_container->get('cache.driver'));
$src_class_loader_ext->set_cache($src_container->get('cache.driver'));
$src_dispatcher = $src_container->get('dispatcher');