1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge pull request #2429 from Nicofuma/ticket/12074

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

* Nicofuma/ticket/12074:
  [ticket/12074] Update the visibility of the constructor
  [ticket/12074] Don't log errors
  [ticket/12074] Managing extensions doesn't produce any log entry
This commit is contained in:
Joas Schilling
2014-05-26 18:55:19 +02:00
7 changed files with 36 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;
public function __construct(\phpbb\extension\manager $manager, \phpbb\log\log $log)
{
$this->manager = $manager;
$this->log = $log;
parent::__construct();
}

View File

@@ -40,6 +40,7 @@ class disable extends command
}
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,6 +35,7 @@ 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;
}

View File

@@ -40,6 +40,7 @@ class purge extends command
}
else
{
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
$output->writeln("<info>Successfully purge extension $name</info>");
return 0;
}