aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/phpbbcli.php
diff options
context:
space:
mode:
authorMate Bartus <mate.bartus@gmail.com>2015-10-18 22:47:04 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-10-22 21:29:52 +0200
commit597297b169e2ae14684ad1f40c8e083be22b241d (patch)
tree41a12be0ddf52aa186e23dc75c05b4ae11d1d9da /phpBB/install/phpbbcli.php
parentcc1a96a8045b6abe5b1234afb045912d53669fee (diff)
downloadforums-597297b169e2ae14684ad1f40c8e083be22b241d.tar
forums-597297b169e2ae14684ad1f40c8e083be22b241d.tar.gz
forums-597297b169e2ae14684ad1f40c8e083be22b241d.tar.bz2
forums-597297b169e2ae14684ad1f40c8e083be22b241d.tar.xz
forums-597297b169e2ae14684ad1f40c8e083be22b241d.zip
[ticket/14044] Deduplicate the installers
PHPBB3-14044
Diffstat (limited to 'phpBB/install/phpbbcli.php')
-rw-r--r--phpBB/install/phpbbcli.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php
new file mode 100644
index 0000000000..ecdb66ade3
--- /dev/null
+++ b/phpBB/install/phpbbcli.php
@@ -0,0 +1,44 @@
+#!/usr/bin/env php
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (php_sapi_name() !== 'cli')
+{
+ echo 'This program must be run from the command line.' . PHP_EOL;
+ exit(1);
+}
+
+define('IN_PHPBB', true);
+define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
+$phpbb_root_path = __DIR__ . '/../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+
+//
+// Let's do the common.php logic
+//
+$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\language\language $language */
+$language = $phpbb_installer_container->get('language');
+$language->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting', 'cli'));
+
+$application = new \phpbb\console\application('phpBB Installer', PHPBB_VERSION, $language);
+$application->setDispatcher($phpbb_installer_container->get('dispatcher'));
+$application->register_container_commands($phpbb_installer_container->get('console.installer.command_collection'));
+$application->run($input);