1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 22:40:39 +02:00

[ticket/12074] Managing extensions doesn't produce any log entry

PHPBB3-12074
This commit is contained in:
Tristan Darricau
2014-05-09 00:07:56 +02:00
parent d4fc060bcd
commit a640a455f3
7 changed files with 65 additions and 2 deletions

View File

@@ -13,9 +13,13 @@ abstract class command extends \phpbb\console\command\command
/** @var \phpbb\extension\manager */
protected $manager;
function __construct(\phpbb\extension\manager $manager)
/** @var \phpbb\log\log */
protected $log;
function __construct(\phpbb\extension\manager $manager, \phpbb\log\log $log)
{
$this->manager = $manager;
$this->log = $log;
parent::__construct();
}

View File

@@ -35,11 +35,13 @@ class disable extends command
if ($this->manager->enabled($name))
{
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_DISABLE_ERROR', time(), array($name));
$output->writeln("<error>Could not disable extension $name</error>");
return 1;
}
else
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_DISABLE', time(), array($name));
$output->writeln("<info>Successfully disabled extension $name</info>");
return 0;
}

View File

@@ -35,11 +35,13 @@ class enable extends command
if ($this->manager->enabled($name))
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXTENSION_ENABLE', time(), array($name));
$output->writeln("<info>Successfully enabled extension $name</info>");
return 0;
}
else
{
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_ENABLE_ERROR', time(), array($name));
$output->writeln("<error>Could not enable extension $name</error>");
return 1;
}

View File

@@ -35,11 +35,13 @@ class purge extends command
if ($this->manager->enabled($name))
{
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_PURGE_ERROR', time(), array($name));
$output->writeln("<error>Could not purge extension $name</error>");
return 1;
}
else
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
$output->writeln("<info>Successfully purge extension $name</info>");
return 0;
}