purge(); $config->increment('assets_version', 1); ?>

INSTALL.html before attempting to update."); } // In case $phpbb_adm_relative_path is not set (in case of an update), use the default. $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/'; $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path; // Include files require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx); require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first $phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx); $phpbb_class_loader->register(); // Set up container (must be done here because extensions table may not exist) $container_extensions = array( new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), new phpbb_di_extension_core($phpbb_root_path), ); $container_passes = array( new phpbb_di_pass_collection_pass(), //new phpbb_di_pass_kernel_pass(), ); $phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx); // Compile the container foreach ($container_passes as $pass) { $phpbb_container->addCompilerPass($pass); } $phpbb_container->compile(); // set up caching $cache = $phpbb_container->get('cache'); // Instantiate some basic classes $phpbb_dispatcher = $phpbb_container->get('dispatcher'); $request = $phpbb_container->get('request'); $user = $phpbb_container->get('user'); $auth = $phpbb_container->get('auth'); $db = $phpbb_container->get('dbal.conn'); $phpbb_log = $phpbb_container->get('log'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function // Grab global variables, re-cache if necessary $config = $phpbb_container->get('config'); set_config(null, null, null, $config); set_config_count(null, null, null, $config); $orig_version = $config['version']; $user->add_lang(array('common', 'acp/common', 'install', 'migrator')); // Add own hook handler, if present. :o if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) { require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display'))); $phpbb_hook_finder = $phpbb_container->get('hook_finder'); foreach ($phpbb_hook_finder->find() as $hook) { @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); } } else { $phpbb_hook = false; } header('Content-type: text/html; charset=UTF-8'); ?> <?php echo $user->lang['UPDATING_TO_LATEST_STABLE']; ?>

lang['UPDATING_TO_LATEST_STABLE']; ?>


lang['DATABASE_TYPE']; ?> :: sql_layer; ?>
lang['PREVIOUS_VERSION']; ?> ::
get('dbal.tools'); if (!$db_tools->sql_table_exists($table_prefix . 'migrations')) { $db_tools->sql_create_table($table_prefix . 'migrations', array( 'COLUMNS' => array( 'migration_name' => array('VCHAR', ''), 'migration_depends_on' => array('TEXT', ''), 'migration_schema_done' => array('BOOL', 0), 'migration_data_done' => array('BOOL', 0), 'migration_data_state' => array('TEXT', ''), 'migration_start_time' => array('TIMESTAMP', 0), 'migration_end_time' => array('TIMESTAMP', 0), ), 'PRIMARY_KEY' => 'migration_name', )); } $migrator = $phpbb_container->get('migrator'); $phpbb_extension_manager = $phpbb_container->get('ext.manager'); $finder = $phpbb_extension_manager->get_finder(); $migrations = $finder ->core_path('phpbb/db/migration/data/') ->get_classes(); $migrator->set_migrations($migrations); // What is a safe limit of execution time? Half the max execution time should be safe. $safe_time_limit = (ini_get('max_execution_time') / 2); while (!$migrator->finished()) { try { $migrator->update(); } catch (phpbb_db_migration_exception $e) { echo $e->getLocalisedMessage($user); phpbb_end_update($cache, $config); } $state = array_merge(array( 'migration_schema_done' => false, 'migration_data_done' => false, ), $migrator->last_run_migration['state'] ); if (isset($migrator->last_run_migration['effectively_installed']) && $migrator->last_run_migration['effectively_installed']) { echo $user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $migrator->last_run_migration['name']) . '
'; } else { if ($state['migration_data_done']) { echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name']) . '
'; } else if ($state['migration_schema_done']) { echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name']) . '
'; } } // Are we approaching the time limit? If so we want to pause the update and continue after refreshing if ((time() - $update_start_time) >= $safe_time_limit) { echo $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
'; echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . ''; phpbb_end_update($cache, $config); } } if ($orig_version != $config['version']) { add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']); } echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '
'; if ($request->variable('type', 0)) { echo $user->lang['INLINE_UPDATE_SUCCESSFUL'] . '

'; echo '' . $user->lang['CONTINUE_UPDATE_NOW'] . ''; } else { echo '

' . $user->lang['UPDATE_FILES_NOTICE'] . '
'; echo $user->lang['COMPLETE_LOGIN_TO_BOARD']; } phpbb_end_update($cache, $config);