phpBB

Code Changes

File: phpbb/console/command/extension/enable.php

  Unmodified   Added   Modified   Removed
Line 37Line 37
		$io = new SymfonyStyle($input, $output);

$name = $input->getArgument('extension-name');

		$io = new SymfonyStyle($input, $output);

$name = $input->getArgument('extension-name');

 

if (!$this->manager->is_available($name))
{
$io->error($this->user->lang('CLI_EXTENSION_NOT_EXIST', $name));
return 1;
}

$extension = $this->manager->get_extension($name);

if (!$extension->is_enableable())
{
$io->error($this->user->lang('CLI_EXTENSION_NOT_ENABLEABLE', $name));
return 1;
}

if ($this->manager->is_enabled($name))
{
$io->error($this->user->lang('CLI_EXTENSION_ENABLED', $name));
return 1;
}


		$this->manager->enable($name);
$this->manager->load_extensions();

if ($this->manager->is_enabled($name))
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));

		$this->manager->enable($name);
$this->manager->load_extensions();

if ($this->manager->is_enabled($name))
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));

 
			$this->check_apcu_cache($io);

			$io->success($this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name));
return 0;
}

			$io->success($this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name));
return 0;
}