mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 20:38:52 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
d87becfa8a
7 changed files with 46 additions and 6 deletions
|
@ -128,6 +128,7 @@ services:
|
||||||
- '@user'
|
- '@user'
|
||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '@log'
|
- '@log'
|
||||||
|
- '%cache.driver.class%'
|
||||||
tags:
|
tags:
|
||||||
- { name: console.command }
|
- { name: console.command }
|
||||||
|
|
||||||
|
@ -137,6 +138,7 @@ services:
|
||||||
- '@user'
|
- '@user'
|
||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '@log'
|
- '@log'
|
||||||
|
- '%cache.driver.class%'
|
||||||
tags:
|
tags:
|
||||||
- { name: console.command }
|
- { name: console.command }
|
||||||
|
|
||||||
|
@ -173,6 +175,7 @@ services:
|
||||||
- '@user'
|
- '@user'
|
||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '@log'
|
- '@log'
|
||||||
|
- '%cache.driver.class%'
|
||||||
tags:
|
tags:
|
||||||
- { name: console.command }
|
- { name: console.command }
|
||||||
|
|
||||||
|
@ -191,6 +194,7 @@ services:
|
||||||
- '@user'
|
- '@user'
|
||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '@log'
|
- '@log'
|
||||||
|
- '%cache.driver.class%'
|
||||||
tags:
|
tags:
|
||||||
- { name: console.command }
|
- { name: console.command }
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ if (empty($lang) || !is_array($lang))
|
||||||
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
|
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
|
||||||
|
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
|
'CLI_APCU_CACHE_NOTICE' => 'APCu cache has to be purged through the Administration Control Panel.',
|
||||||
|
|
||||||
'CLI_CONFIG_CANNOT_CACHED' => 'Set this option if the configuration option changes too frequently to be efficiently cached.',
|
'CLI_CONFIG_CANNOT_CACHED' => 'Set this option if the configuration option changes too frequently to be efficiently cached.',
|
||||||
'CLI_CONFIG_CURRENT' => 'Current configuration value, use 0 and 1 to specify boolean values',
|
'CLI_CONFIG_CURRENT' => 'Current configuration value, use 0 and 1 to specify boolean values',
|
||||||
'CLI_CONFIG_DELETE_SUCCESS' => 'Successfully deleted config %s.',
|
'CLI_CONFIG_DELETE_SUCCESS' => 'Successfully deleted config %s.',
|
||||||
|
|
3
phpBB/phpbb/cache/driver/apcu.php
vendored
3
phpBB/phpbb/cache/driver/apcu.php
vendored
|
@ -24,12 +24,15 @@ class apcu extends \phpbb\cache\driver\memory
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
function purge()
|
function purge()
|
||||||
|
{
|
||||||
|
if (PHP_SAPI !== 'cli' || @ini_get('apc.enable_cli'))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Use an iterator to selectively delete our cache entries without disturbing
|
* Use an iterator to selectively delete our cache entries without disturbing
|
||||||
* any other cache users (e.g. other phpBB boards hosted on this server)
|
* any other cache users (e.g. other phpBB boards hosted on this server)
|
||||||
*/
|
*/
|
||||||
apcu_delete(new \APCUIterator('#^' . $this->key_prefix . '#'));
|
apcu_delete(new \APCUIterator('#^' . $this->key_prefix . '#'));
|
||||||
|
}
|
||||||
|
|
||||||
parent::purge();
|
parent::purge();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
*/
|
*/
|
||||||
namespace phpbb\console\command\extension;
|
namespace phpbb\console\command\extension;
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
|
||||||
abstract class command extends \phpbb\console\command\command
|
abstract class command extends \phpbb\console\command\command
|
||||||
{
|
{
|
||||||
/** @var \phpbb\extension\manager */
|
/** @var \phpbb\extension\manager */
|
||||||
|
@ -20,11 +22,37 @@ abstract class command extends \phpbb\console\command\command
|
||||||
/** @var \phpbb\log\log */
|
/** @var \phpbb\log\log */
|
||||||
protected $log;
|
protected $log;
|
||||||
|
|
||||||
public function __construct(\phpbb\user $user, \phpbb\extension\manager $manager, \phpbb\log\log $log)
|
/** @var string Cache driver class */
|
||||||
|
protected $cache_driver_class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param \phpbb\user $user User object
|
||||||
|
* @param \phpbb\extension\manager $manager Extension manager object
|
||||||
|
* @param \phpbb\log\log $log Log object
|
||||||
|
* @param string $cache_driver_class Cache driver class
|
||||||
|
*/
|
||||||
|
public function __construct(\phpbb\user $user, \phpbb\extension\manager $manager, \phpbb\log\log $log, $cache_driver_class)
|
||||||
{
|
{
|
||||||
$this->manager = $manager;
|
$this->manager = $manager;
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
|
$this->cache_driver_class = $cache_driver_class;
|
||||||
|
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if APCu cache driver is used and enabled for CLI, otherwise display a notice.
|
||||||
|
*
|
||||||
|
* @param SymfonyStyle $io
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function check_apcu_cache(SymfonyStyle $io)
|
||||||
|
{
|
||||||
|
if ($this->cache_driver_class === 'phpbb\\cache\\driver\\apcu' && !@ini_get('apc.enable_cli'))
|
||||||
|
{
|
||||||
|
$io->note($this->user->lang('CLI_APCU_CACHE_NOTICE'));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ class disable extends command
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_DISABLE', time(), array($name));
|
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_DISABLE', time(), array($name));
|
||||||
|
$this->check_apcu_cache($io);
|
||||||
$io->success($this->user->lang('CLI_EXTENSION_DISABLE_SUCCESS', $name));
|
$io->success($this->user->lang('CLI_EXTENSION_DISABLE_SUCCESS', $name));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ class enable extends command
|
||||||
if ($this->manager->is_enabled($name))
|
if ($this->manager->is_enabled($name))
|
||||||
{
|
{
|
||||||
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($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));
|
$io->success($this->user->lang('CLI_EXTENSION_ENABLE_SUCCESS', $name));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ class purge extends command
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
|
$this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_PURGE', time(), array($name));
|
||||||
|
$this->check_apcu_cache($io);
|
||||||
$io->success($this->user->lang('CLI_EXTENSION_PURGE_SUCCESS', $name));
|
$io->success($this->user->lang('CLI_EXTENSION_PURGE_SUCCESS', $name));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue