1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/13740] Exit from installation if phpBB is already installed

PHPBB3-13740
This commit is contained in:
Mate Bartus
2015-07-20 19:26:07 +02:00
parent 6216007caa
commit 0488c49116
8 changed files with 103 additions and 12 deletions

View File

@@ -219,7 +219,7 @@ class helper
protected function render_language_select()
{
$langs = $this->lang_helper->get_available_languages();
// @todo
// @todo Implement language change option
}
/**

View File

@@ -13,7 +13,9 @@
namespace phpbb\install\controller;
use phpbb\exception\http_exception;
use phpbb\install\helper\config;
use phpbb\install\helper\install_helper;
use phpbb\install\helper\navigation\navigation_provider;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\Response;
@@ -69,6 +71,11 @@ class install
*/
protected $installer;
/**
* @var install_helper
*/
protected $install_helper;
/**
* Constructor
*
@@ -80,8 +87,9 @@ class install
* @param template $template
* @param request_interface $request
* @param installer $installer
* @param install_helper $install_helper
*/
public function __construct(helper $helper, config $install_config, factory $factory, navigation_provider $nav_provider, language $language, template $template, request_interface $request, installer $installer)
public function __construct(helper $helper, config $install_config, factory $factory, navigation_provider $nav_provider, language $language, template $template, request_interface $request, installer $installer, install_helper $install_helper)
{
$this->controller_helper = $helper;
$this->installer_config = $install_config;
@@ -91,6 +99,7 @@ class install
$this->template = $template;
$this->request = $request;
$this->installer = $installer;
$this->install_helper = $install_helper;
}
/**
@@ -100,8 +109,6 @@ class install
*/
public function handle()
{
// @todo check that phpBB is not already installed
$this->template->assign_vars(array(
'U_ACTION' => $this->controller_helper->route('phpbb_installer_install'),
));
@@ -124,6 +131,11 @@ class install
/** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
$iohandler = $this->iohandler_factory->get();
if ($this->install_helper->is_phpbb_installed())
{
throw new http_exception(404, 'PAGE_NOT_FOUND');
}
// Set active navigation stage
if (isset($nav_data['active']) && is_array($nav_data['active']))
{