diff options
Diffstat (limited to 'phpBB/phpbb/console/command')
| -rw-r--r-- | phpBB/phpbb/console/command/cron/run.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/extension/enable.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/fixup/recalculate_email_hash.php | 76 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/update/check.php | 3 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/user/add.php | 2 | 
5 files changed, 11 insertions, 82 deletions
| diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index dea6493007..511c6bc01b 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -73,7 +73,7 @@ class run extends \phpbb\console\command\command  	* @param InputInterface $input The input stream used to get the argument and verboe option.  	* @param OutputInterface $output The output stream, used for printing verbose-mode and error information.  	* -	* @return int 0 if all is ok, 1 if a lock error occured and 2 if no task matching the argument was found. +	* @return int 0 if all is ok, 1 if a lock error occurred and 2 if no task matching the argument was found.  	*/  	protected function execute(InputInterface $input, OutputInterface $output)  	{ @@ -145,9 +145,11 @@ class run extends \phpbb\console\command\command  	*		and returns with status 2.  	*  	* @see execute -	* @param string $task_name The name of the task that should be run. +	*  	* @param InputInterface $input The input stream used to get the argument and verbose option.  	* @param OutputInterface $output The output stream, used for printing verbose-mode and error information. +	* @param string $task_name The name of the task that should be run. +	*  	* @return int 0 if all is well, 2 if no task matches $task_name.  	*/  	protected function run_one(InputInterface $input, OutputInterface $output, $task_name) diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index a6f5b10e86..504b5546b3 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -46,9 +46,11 @@ class enable extends command  		$extension = $this->manager->get_extension($name); -		if (!$extension->is_enableable()) +		if (($enableable = $extension->is_enableable()) !== true)  		{ -			$io->error($this->user->lang('CLI_EXTENSION_NOT_ENABLEABLE', $name)); +			$message = !empty($enableable) ? $enableable : $this->user->lang('CLI_EXTENSION_NOT_ENABLEABLE', $name); +			$message = is_array($message) ? implode(PHP_EOL, $message) : $message; +			$io->error($message);  			return 1;  		} diff --git a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php deleted file mode 100644 index 6f7096296d..0000000000 --- a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php +++ /dev/null @@ -1,76 +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\console\command\fixup; - -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; - -class recalculate_email_hash extends \phpbb\console\command\command -{ -	/** @var \phpbb\db\driver\driver_interface */ -	protected $db; - -	public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db) -	{ -		$this->db = $db; - -		parent::__construct($user); -	} - -	protected function configure() -	{ -		$this -			->setName('fixup:recalculate-email-hash') -			->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH')) -		; -	} - -	protected function execute(InputInterface $input, OutputInterface $output) -	{ -		$io = new SymfonyStyle($input, $output); - -		$sql = 'SELECT user_id, user_email, user_email_hash -			FROM ' . USERS_TABLE . ' -			WHERE user_type <> ' . USER_IGNORE . " -				AND user_email <> ''"; -		$result = $this->db->sql_query($sql); - -		while ($row = $this->db->sql_fetchrow($result)) -		{ -			$user_email_hash = phpbb_email_hash($row['user_email']); -			if ($user_email_hash !== $row['user_email_hash']) -			{ -				$sql_ary = array( -					'user_email_hash'	=> $user_email_hash, -				); - -				$sql = 'UPDATE ' . USERS_TABLE . ' -					SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' -					WHERE user_id = ' . (int) $row['user_id']; -				$this->db->sql_query($sql); - -				if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) -				{ -					$io->table( -						array('user_id', 'user_email', 'user_email_hash'), -						array(array($row['user_id'], $row['user_email'], $user_email_hash)) -					); -				} -			} -		} -		$this->db->sql_freeresult($result); - -		$io->success($this->user->lang('CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS')); -	} -} diff --git a/phpBB/phpbb/console/command/update/check.php b/phpBB/phpbb/console/command/update/check.php index 9ced651e8b..4cd7d2155c 100644 --- a/phpBB/phpbb/console/command/update/check.php +++ b/phpBB/phpbb/console/command/update/check.php @@ -77,7 +77,7 @@ class check extends \phpbb\console\command\command  	*  	* @param InputInterface $input Input stream, used to get the options.  	* @param OutputInterface $output Output stream, used to print messages. -	* @return int 0 if the board is up to date, 1 if it is not and 2 if an error occured. +	* @return int 0 if the board is up to date, 1 if it is not and 2 if an error occurred.  	* @throws \RuntimeException  	*/  	protected function execute(InputInterface $input, OutputInterface $output) @@ -223,6 +223,7 @@ class check extends \phpbb\console\command\command  	* Check if all the available extensions are up to date  	*  	* @param SymfonyStyle	$io			IO handler, for formatted and unified IO +	* @param string			$stability	Stability specifier string  	* @param bool			$recheck	Disallow the use of the cache  	* @return int  	*/ diff --git a/phpBB/phpbb/console/command/user/add.php b/phpBB/phpbb/console/command/user/add.php index c60a059251..303216a93d 100644 --- a/phpBB/phpbb/console/command/user/add.php +++ b/phpBB/phpbb/console/command/user/add.php @@ -239,7 +239,7 @@ class add extends command  				array('string', false, $this->config['min_name_chars'], $this->config['max_name_chars']),  				array('username', '')),  			'new_password' => array( -				array('string', false, $this->config['min_pass_chars'], $this->config['max_pass_chars']), +				array('string', false, $this->config['min_pass_chars'], 0),  				array('password')),  			'email'        => array(  				array('string', false, 6, 60), | 
