mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/13740] Fix CS and docblocks
PHPBB3-13740
This commit is contained in:
parent
0488c49116
commit
b2b9fb1df2
10 changed files with 36 additions and 62 deletions
|
@ -110,13 +110,15 @@ class install extends \phpbb\console\command\command
|
|||
if ($this->install_helper->is_phpbb_installed())
|
||||
{
|
||||
$iohandler->add_error_message('PHPBB_ALREADY_INSTALLED');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!is_file($config_file))
|
||||
{
|
||||
$iohandler->add_error_message(array('MISSING_FILE', array($config_file)));
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -127,7 +129,7 @@ class install extends \phpbb\console\command\command
|
|||
{
|
||||
$iohandler->add_error_message('INVALID_YAML_FILE');
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$processor = new Processor();
|
||||
|
@ -141,7 +143,7 @@ class install extends \phpbb\console\command\command
|
|||
{
|
||||
$iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->register_configuration($iohandler, $config);
|
||||
|
@ -153,7 +155,7 @@ class install extends \phpbb\console\command\command
|
|||
catch (installer_exception $e)
|
||||
{
|
||||
$iohandler->add_error_message($e->getMessage());
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,11 @@ class install
|
|||
*/
|
||||
public function handle()
|
||||
{
|
||||
if ($this->install_helper->is_phpbb_installed())
|
||||
{
|
||||
throw new http_exception(404, 'PAGE_NOT_FOUND');
|
||||
}
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'U_ACTION' => $this->controller_helper->route('phpbb_installer_install'),
|
||||
));
|
||||
|
@ -131,11 +136,6 @@ 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']))
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
namespace phpbb\install\exception;
|
||||
|
||||
/**
|
||||
* This exception should be thrown when
|
||||
* Thrown when the container cannot be built
|
||||
*/
|
||||
class cannot_build_container_exception extends installer_exception
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
namespace phpbb\install\exception;
|
||||
|
||||
/**
|
||||
* Exception for the event when installer config is not writable to disk
|
||||
* Thrown when installer config is not writable to disk
|
||||
*/
|
||||
class installer_config_not_writable_exception extends installer_exception
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
namespace phpbb\install\exception;
|
||||
|
||||
/**
|
||||
* This exception should be thrown when
|
||||
* Thrown when an unavailable DBMS has been selected
|
||||
*/
|
||||
class invalid_dbms_exception extends installer_exception
|
||||
{
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?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.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\install\exception;
|
||||
|
||||
class invalid_service_name_exception extends installer_exception
|
||||
{
|
||||
|
||||
}
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
namespace phpbb\install\exception;
|
||||
|
||||
/**
|
||||
* Thrown when the installer is out of memory or time
|
||||
*/
|
||||
class resource_limit_reached_exception extends installer_exception
|
||||
{
|
||||
|
||||
|
|
|
@ -93,9 +93,26 @@ class container_factory
|
|||
* @param string $param_name
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built
|
||||
*/
|
||||
public function get_parameter($param_name)
|
||||
{
|
||||
// Check if container was built, if not try to build it
|
||||
if ($this->container === null)
|
||||
{
|
||||
// Check whether container can be built
|
||||
// We need config.php for that so let's check if it has been set up yet
|
||||
if (filesize($this->phpbb_root_path . 'config.' . $this->php_ext))
|
||||
{
|
||||
$this->build_container();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new cannot_build_container_exception();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->container->getParameter($param_name);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,10 +96,6 @@ class ajax_iohandler extends iohandler_base
|
|||
*/
|
||||
public function add_user_form_group($title, $form)
|
||||
{
|
||||
//
|
||||
// This code is pretty ugly... but works
|
||||
//
|
||||
|
||||
$this->template->assign_var('S_FORM_ELEM_COUNT', sizeof($form));
|
||||
|
||||
$this->template->assign_block_vars('options', array(
|
||||
|
@ -166,8 +162,8 @@ class ajax_iohandler extends iohandler_base
|
|||
$json_data = json_encode($json_data_array);
|
||||
|
||||
// Try to push content to the browser
|
||||
print (str_pad(' ', 4096) . "\n");
|
||||
print ($json_data . "\n\n");
|
||||
print(str_pad(' ', 4096) . "\n");
|
||||
print($json_data . "\n\n");
|
||||
flush();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ namespace phpbb\install;
|
|||
|
||||
use phpbb\di\ordered_service_collection;
|
||||
use phpbb\install\exception\installer_config_not_writable_exception;
|
||||
use phpbb\install\exception\invalid_service_name_exception;
|
||||
use phpbb\install\exception\resource_limit_reached_exception;
|
||||
use phpbb\install\exception\user_interaction_required_exception;
|
||||
use phpbb\install\helper\config;
|
||||
|
@ -94,9 +93,6 @@ class installer
|
|||
// Variable used to check if the install process have been finished
|
||||
$install_finished = false;
|
||||
|
||||
// Flag used by exception handling, whether or not we need to flush output buffer once again
|
||||
$flush_messages = false;
|
||||
|
||||
// We are installing something, so the introduction stage can go now...
|
||||
$this->install_config->set_finished_navigation_stage(array('install', 0, 'introduction'));
|
||||
$this->iohandler->set_finished_stage_menu(array('install', 0, 'introduction'));
|
||||
|
@ -184,22 +180,6 @@ class installer
|
|||
{
|
||||
// Do nothing
|
||||
}
|
||||
catch (invalid_service_name_exception $e)
|
||||
{
|
||||
$params = $e->get_parameters();
|
||||
|
||||
if (!empty($params))
|
||||
{
|
||||
array_unshift($params, $e->getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
$params = $e->getMessage();
|
||||
}
|
||||
|
||||
$this->iohandler->add_error_message($params);
|
||||
$flush_messages = true;
|
||||
}
|
||||
|
||||
if ($install_finished)
|
||||
{
|
||||
|
@ -211,11 +191,6 @@ class installer
|
|||
$this->iohandler->request_refresh();
|
||||
}
|
||||
|
||||
if ($flush_messages)
|
||||
{
|
||||
$this->iohandler->send_response();
|
||||
}
|
||||
|
||||
// Save install progress
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue