diff options
| -rw-r--r-- | phpBB/language/en/cli.php | 2 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/extension/disable.php | 7 | ||||
| -rw-r--r-- | phpBB/phpbb/console/command/extension/enable.php | 7 | 
3 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php index 9940609364..35f56be008 100644 --- a/phpBB/language/en/cli.php +++ b/phpBB/language/en/cli.php @@ -110,8 +110,10 @@ $lang = array_merge($lang, array(  	'CLI_EXTENSION_DISABLE_FAILURE'		=> 'Could not disable extension %s',  	'CLI_EXTENSION_DISABLE_SUCCESS'		=> 'Successfully disabled extension %s', +	'CLI_EXTENSION_ALREADY_DISABLED'	=> 'Extension %s was already disabled',  	'CLI_EXTENSION_ENABLE_FAILURE'		=> 'Could not enable extension %s',  	'CLI_EXTENSION_ENABLE_SUCCESS'		=> 'Successfully enabled extension %s', +	'CLI_EXTENSION_ALREADY_ENABLED'		=> 'Extension %s was already enabled',  	'CLI_EXTENSION_NAME'				=> 'Name of the extension',  	'CLI_EXTENSION_PURGE_FAILURE'		=> 'Could not purge extension %s',  	'CLI_EXTENSION_PURGE_SUCCESS'		=> 'Successfully purged extension %s', diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index d022755753..be5c77a9a0 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -37,6 +37,13 @@ class disable extends command  		$io = new SymfonyStyle($input, $output);  		$name = $input->getArgument('extension-name'); + +		if (!$this->manager->is_enabled($name)) +		{ +			$io->error($this->user->lang('CLI_EXTENSION_ALREADY_DISABLED', $name)); +			return 1; +		} +		  		$this->manager->disable($name);  		$this->manager->load_extensions(); diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 14077d688b..2de7498c71 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,6 +37,13 @@ class enable extends command  		$io = new SymfonyStyle($input, $output);  		$name = $input->getArgument('extension-name'); + +		if ($this->manager->is_enabled($name)) +		{ +			$io->error($this->user->lang('CLI_EXTENSION_ALREADY_ENABLED', $name)); +			return 1; +		} +		  		$this->manager->enable($name);  		$this->manager->load_extensions();  | 
