From 597297b169e2ae14684ad1f40c8e083be22b241d Mon Sep 17 00:00:00 2001
From: Mate Bartus
Date: Sun, 18 Oct 2015 22:47:04 +0200
Subject: [ticket/14044] Deduplicate the installers
PHPBB3-14044
---
phpBB/install/app.php | 59 +
phpBB/install/database_update.php | 270 -----
phpBB/install/index.php | 874 --------------
phpBB/install/install_convert.php | 2153 ---------------------------------
phpBB/install/install_install.php | 2368 -------------------------------------
phpBB/install/install_main.php | 78 --
phpBB/install/install_update.php | 1789 ----------------------------
phpBB/install/phpbbcli.php | 44 +
phpBB/install/phpinfo.php | 14 -
phpBB/install/startup.php | 84 ++
10 files changed, 187 insertions(+), 7546 deletions(-)
create mode 100644 phpBB/install/app.php
delete mode 100644 phpBB/install/database_update.php
delete mode 100644 phpBB/install/index.php
delete mode 100644 phpBB/install/install_convert.php
delete mode 100644 phpBB/install/install_install.php
delete mode 100644 phpBB/install/install_main.php
delete mode 100644 phpBB/install/install_update.php
create mode 100644 phpBB/install/phpbbcli.php
delete mode 100644 phpBB/install/phpinfo.php
create mode 100644 phpBB/install/startup.php
(limited to 'phpBB/install')
diff --git a/phpBB/install/app.php b/phpBB/install/app.php
new file mode 100644
index 0000000000..9346351aba
--- /dev/null
+++ b/phpBB/install/app.php
@@ -0,0 +1,59 @@
+
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+/**
+ * @ignore
+ */
+define('IN_PHPBB', true);
+define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
+$phpbb_root_path = '../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+
+$startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx;
+$startup_path = (file_exists($startup_new_path)) ? $startup_new_path : $phpbb_root_path . 'install/startup.' . $phpEx;
+require($startup_path);
+
+/** @var \phpbb\filesystem\filesystem $phpbb_filesystem */
+$phpbb_filesystem = $phpbb_installer_container->get('filesystem');
+
+/** @var \phpbb\template\template $template */
+$template = $phpbb_installer_container->get('template');
+
+
+// Path to templates
+$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
+$paths = array_filter($paths, 'is_dir');
+
+$template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+), $paths);
+
+/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
+$phpbb_dispatcher = $phpbb_installer_container->get('dispatcher');
+
+/** @var \phpbb\language\language $language */
+$language = $phpbb_installer_container->get('language');
+$language->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting'));
+
+/* @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel */
+$http_kernel = $phpbb_installer_container->get('http_kernel');
+
+/* @var $symfony_request \phpbb\symfony_request */
+$symfony_request = $phpbb_installer_container->get('symfony_request');
+$response = $http_kernel->handle($symfony_request);
+$response->send();
+$http_kernel->terminate($symfony_request, $response);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
deleted file mode 100644
index a611a33125..0000000000
--- a/phpBB/install/database_update.php
+++ /dev/null
@@ -1,270 +0,0 @@
-
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-$update_start_time = time();
-
-/**
-* @ignore
-*/
-define('IN_PHPBB', true);
-define('IN_INSTALL', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
-function phpbb_end_update($cache, $config)
-{
- $cache->purge();
-
- $config->increment('assets_version', 1);
-
-?>
-
-
-
-
-
-
-
-
-
-
-