From 9aed758c1397c31b979f4aca51249c73d21bd6f5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jul 2013 14:24:07 +0200 Subject: [ticket/9657] Use the service instead of the static class PHPBB3-9657 --- phpBB/includes/feed/base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/feed/base.php') diff --git a/phpBB/includes/feed/base.php b/phpBB/includes/feed/base.php index af28ee8dc8..84fdbe415a 100644 --- a/phpBB/includes/feed/base.php +++ b/phpBB/includes/feed/base.php @@ -80,10 +80,11 @@ abstract class phpbb_feed_base * @param phpbb_cache_driver_interface $cache Cache object * @param phpbb_user $user User object * @param phpbb_auth $auth Auth object + * @param phpbb_content_visibility $content_visibility Auth object * @param string $phpEx php file extension * @return null */ - function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, $phpEx) + function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, $content_visibility, $phpEx) { $this->config = $config; $this->helper = $helper; @@ -91,6 +92,7 @@ abstract class phpbb_feed_base $this->cache = $cache; $this->user = $user; $this->auth = $auth; + $this->content_visibility = $content_visibility; $this->phpEx = $phpEx; $this->set_keys(); -- cgit v1.2.1 From 003a104f931201704998f5c00c5cf982896b470b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jul 2013 22:41:24 -0400 Subject: [ticket/9657] Add type hints for classes PHPBB3-9657 --- phpBB/includes/feed/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/feed/base.php') diff --git a/phpBB/includes/feed/base.php b/phpBB/includes/feed/base.php index 84fdbe415a..296d830932 100644 --- a/phpBB/includes/feed/base.php +++ b/phpBB/includes/feed/base.php @@ -84,7 +84,7 @@ abstract class phpbb_feed_base * @param string $phpEx php file extension * @return null */ - function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, $content_visibility, $phpEx) + function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, phpbb_content_visibility $content_visibility, $phpEx) { $this->config = $config; $this->helper = $helper; -- cgit v1.2.1 From 7030578bbe9e11c18b5becaf8b06e670e3c2e3cd Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 14 Jul 2013 01:32:34 -0400 Subject: [ticket/11698] Moving all autoloadable files to phpbb/ PHPBB3-11698 --- phpBB/includes/feed/base.php | 261 ------------------------------------------- 1 file changed, 261 deletions(-) delete mode 100644 phpBB/includes/feed/base.php (limited to 'phpBB/includes/feed/base.php') diff --git a/phpBB/includes/feed/base.php b/phpBB/includes/feed/base.php deleted file mode 100644 index 296d830932..0000000000 --- a/phpBB/includes/feed/base.php +++ /dev/null @@ -1,261 +0,0 @@ -config = $config; - $this->helper = $helper; - $this->db = $db; - $this->cache = $cache; - $this->user = $user; - $this->auth = $auth; - $this->content_visibility = $content_visibility; - $this->phpEx = $phpEx; - - $this->set_keys(); - - // Allow num_items to be string - if (is_string($this->num_items)) - { - $this->num_items = (int) $this->config[$this->num_items]; - - // A precaution - if (!$this->num_items) - { - $this->num_items = 10; - } - } - } - - /** - * Set keys. - */ - function set_keys() - { - } - - /** - * Open feed - */ - function open() - { - } - - /** - * Close feed - */ - function close() - { - if (!empty($this->result)) - { - $this->db->sql_freeresult($this->result); - } - } - - /** - * Set key - */ - function set($key, $value) - { - $this->keys[$key] = $value; - } - - /** - * Get key - */ - function get($key) - { - return (isset($this->keys[$key])) ? $this->keys[$key] : NULL; - } - - function get_readable_forums() - { - static $forum_ids; - - if (!isset($forum_ids)) - { - $forum_ids = array_keys($this->auth->acl_getf('f_read', true)); - } - - return $forum_ids; - } - - function get_moderator_approve_forums() - { - static $forum_ids; - - if (!isset($forum_ids)) - { - $forum_ids = array_keys($this->auth->acl_getf('m_approve', true)); - } - - return $forum_ids; - } - - function is_moderator_approve_forum($forum_id) - { - static $forum_ids; - - if (!isset($forum_ids)) - { - $forum_ids = array_flip($this->get_moderator_approve_forums()); - } - - return (isset($forum_ids[$forum_id])) ? true : false; - } - - function get_excluded_forums() - { - static $forum_ids; - - // Matches acp/acp_board.php - $cache_name = 'feed_excluded_forum_ids'; - - if (!isset($forum_ids) && ($forum_ids = $this->cache->get('_' . $cache_name)) === false) - { - $sql = 'SELECT forum_id - FROM ' . FORUMS_TABLE . ' - WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '<> 0'); - $result = $this->db->sql_query($sql); - - $forum_ids = array(); - while ($forum_id = (int) $this->db->sql_fetchfield('forum_id')) - { - $forum_ids[$forum_id] = $forum_id; - } - $this->db->sql_freeresult($result); - - $this->cache->put('_' . $cache_name, $forum_ids); - } - - return $forum_ids; - } - - function is_excluded_forum($forum_id) - { - $forum_ids = $this->get_excluded_forums(); - - return isset($forum_ids[$forum_id]) ? true : false; - } - - function get_passworded_forums() - { - return $this->user->get_passworded_forums(); - } - - function get_item() - { - static $result; - - if (!isset($result)) - { - if (!$this->get_sql()) - { - return false; - } - - // Query database - $sql = $this->db->sql_build_query('SELECT', $this->sql); - $result = $this->db->sql_query_limit($sql, $this->num_items); - } - - return $this->db->sql_fetchrow($result); - } - - function user_viewprofile($row) - { - $author_id = (int) $row[$this->get('author_id')]; - - if ($author_id == ANONYMOUS) - { - // Since we cannot link to a profile, we just return GUEST - // instead of $row['username'] - return $this->user->lang['GUEST']; - } - - return '' . $row[$this->get('creator')] . ''; - } -} -- cgit v1.2.1