diff options
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/console/command/cache/purge.php | 62 | ||||
-rw-r--r-- | phpBB/phpbb/feed/forum.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/feed/topic.php | 7 |
3 files changed, 70 insertions, 0 deletions
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php new file mode 100644 index 0000000000..017bdc5144 --- /dev/null +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -0,0 +1,62 @@ +<?php +/** +* +* @package phpBB3 +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ +namespace phpbb\console\command\cache; + +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class purge extends \phpbb\console\command\command +{ + /** @var \phpbb\cache\driver\driver_interface */ + protected $cache; + + /** @var \phpbb\db\driver\driver_interface */ + protected $db; + + /** @var \phpbb\auth\auth */ + protected $auth; + + /** @var \phpbb\log\log */ + protected $log; + + /** @var \phpbb\user */ + protected $user; + + function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user) + { + $this->cache = $cache; + $this->db = $db; + $this->auth = $auth; + $this->log = $log; + $this->user = $user; + $this->user->add_lang(array('acp/common')); + parent::__construct(); + } + + protected function configure() + { + $this + ->setName('cache:purge') + ->setDescription('Purge the cache.') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->cache->purge(); + + // Clear permissions + $this->auth->acl_clear_prefetch(); + phpbb_cache_moderators($this->db, $this->cache, $this->auth); + + $this->log->add('admin', ANONYMOUS, '', 'LOG_PURGE_CACHE', time(), array()); + + $output->writeln($this->user->lang('PURGE_CACHE_SUCCESS')); + } +} diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php index 8e6490923d..e35ec4baa4 100644 --- a/phpBB/phpbb/feed/forum.php +++ b/phpBB/phpbb/feed/forum.php @@ -132,6 +132,7 @@ class forum extends \phpbb\feed\post_base parent::adjust_item($item_row, $row); $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + $item_row['forum_id'] = $this->forum_id; } function get_item() diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php index fb49aa65cc..10b0f4f645 100644 --- a/phpBB/phpbb/feed/topic.php +++ b/phpBB/phpbb/feed/topic.php @@ -105,6 +105,13 @@ class topic extends \phpbb\feed\post_base return true; } + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['forum_id'] = $this->forum_id; + } + function get_item() { return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row; |