Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 24
n/a
0 / 0
CRAP
n/a
0 / 0
1#!/usr/bin/env php
2<?php
3/**
4*
5* This file is part of the phpBB Forum Software package.
6*
7* @copyright (c) phpBB Limited <https://www.phpbb.com>
8* @license GNU General Public License, version 2 (GPL-2.0)
9*
10* For full copyright and license information, please see
11* the docs/CREDITS.txt file.
12*
13*/
14
15use Symfony\Component\Console\Input\ArgvInput;
16
17if (php_sapi_name() !== 'cli')
18{
19    echo 'This program must be run from the command line.' . PHP_EOL;
20    exit(1);
21}
22
23define('IN_PHPBB', true);
24define('IN_INSTALL', true);
25define('PHPBB_ENVIRONMENT', 'production');
26define('PHPBB_VERSION', '4.0.0-a1');
27$phpbb_root_path = __DIR__ . '/../';
28$phpEx = substr(strrchr(__FILE__, '.'), 1);
29
30//
31// Let's do the common.php logic
32//
33$startup_new_path = $phpbb_root_path . 'install/update/update/new/install/startup.' . $phpEx;
34$startup_path = (file_exists($startup_new_path)) ? $startup_new_path : $phpbb_root_path . 'install/startup.' . $phpEx;
35require($startup_path);
36
37$input = new ArgvInput();
38
39// Enable superglobals for cli support
40$phpbb_installer_container->get('request')->enable_super_globals();
41
42/** @var \phpbb\filesystem\filesystem $phpbb_filesystem */
43$phpbb_filesystem = $phpbb_installer_container->get('filesystem');
44
45/** @var \phpbb\config\config $config */
46$config = $phpbb_installer_container->get('config');
47
48/** @var \phpbb\language\language $language */
49$language = $phpbb_installer_container->get('language');
50$language->add_lang(array('common', 'acp/common', 'acp/board', 'install', 'posting', 'cli'));
51
52$application = new \phpbb\console\application('phpBB Installer', PHPBB_VERSION, $language, $config);
53$application->setDispatcher($phpbb_installer_container->get('event_dispatcher'));
54$application->register_container_commands($phpbb_installer_container->get('console.installer.command_collection'));
55$application->run($input);