From e3b0e1a8a23b5627388df2b57ef82737c01dd1a1 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sun, 11 Nov 2012 10:44:47 +0000 Subject: [PATCH 01/16] [ticket/11190] Functional tests purge cache before running. Added functions to get and purge cache to functional framework also. PHPBB3-11190 --- .../phpbb_functional_test_case.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d35913e415..bd248a662e 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -9,11 +9,14 @@ use Symfony\Component\BrowserKit\CookieJar; require_once __DIR__ . '/../../phpBB/includes/functions_install.php'; +require_once __DIR__ . '/../../phpBB/includes/acm/acm_file.php'; +require_once __DIR__ . '/../../phpBB/includes/cache.php'; class phpbb_functional_test_case extends phpbb_test_case { protected $client; protected $root_url; + protected $cache = null; /** * Session ID for current test's session (each test makes its own) @@ -47,6 +50,7 @@ class phpbb_functional_test_case extends phpbb_test_case // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); + $this->purge_cache(); } public function request($method, $path) @@ -61,6 +65,25 @@ class phpbb_functional_test_case extends phpbb_test_case { } + protected function get_cache_driver() + { + if (!$this->cache) + { + $this->cache = new cache(); + } + + return $this->cache; + } + + protected function purge_cache() + { + $cache = $this->get_cache_driver(); + + $cache->purge(); + $cache->unload(); + $cache->load(); + } + public function __construct($name = NULL, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); From db0cc74af073ede415b1ff21556a31f01ecfbe8f Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sun, 11 Nov 2012 10:51:53 +0000 Subject: [PATCH 02/16] [ticket/11190-develop] Functional tests purge cache before running. PHPBB3-11190 --- tests/test_framework/phpbb_functional_test_case.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 41edb3e6af..eb2b497708 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -51,6 +51,7 @@ class phpbb_functional_test_case extends phpbb_test_case // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); + $this->purge_cache(); } public function request($method, $path) From d2a051cdd4269fd5749bdd4e7619fc5176a510a8 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 11 Nov 2012 18:39:24 +0100 Subject: [PATCH 03/16] [ticket/11193] Instantiate a single collection_pass for all collections PHPBB3-11193 --- phpBB/common.php | 2 +- phpBB/config/services.yml | 2 ++ phpBB/download/file.php | 2 +- phpBB/includes/di/pass/collection_pass.php | 25 +++++++++++----------- phpBB/install/database_update.php | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index 002d435b6e..c4237dfcf5 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -94,7 +94,7 @@ $phpbb_container = phpbb_create_dumped_container_unless_debug( new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_collection_pass('cron.task_collection', 'cron.task'), + new phpbb_di_pass_collection_pass(), ), $phpbb_root_path, $phpEx diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index 42bb473e66..20aa0546d5 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -48,6 +48,8 @@ services: class: phpbb_di_service_collection arguments: - @service_container + tags: + - { name: service_collection, tag: cron.task } cron.manager: class: phpbb_cron_manager diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 95b20a88d2..79f53245b9 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -65,7 +65,7 @@ if (isset($_GET['avatar'])) new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_collection_pass('cron.task_collection', 'cron.task'), + new phpbb_di_pass_collection_pass(), ), $phpbb_root_path, $phpEx diff --git a/phpBB/includes/di/pass/collection_pass.php b/phpBB/includes/di/pass/collection_pass.php index 70a44d1d51..d5b82f61da 100644 --- a/phpBB/includes/di/pass/collection_pass.php +++ b/phpBB/includes/di/pass/collection_pass.php @@ -18,17 +18,13 @@ if (!defined('IN_PHPBB')) use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +/** +* Appends an add method call to the definition of each collection service for +* the services tagged with the appropriate name defined in the collection's +* service_collection tag. +*/ class phpbb_di_pass_collection_pass implements CompilerPassInterface { - private $collection_service; - private $service_tag; - - public function __construct($collection_service, $service_tag) - { - $this->collection_service = $collection_service; - $this->service_tag = $service_tag; - } - /** * Modify the container before it is passed to the rest of the code * @@ -37,11 +33,14 @@ class phpbb_di_pass_collection_pass implements CompilerPassInterface */ public function process(ContainerBuilder $container) { - $definition = $container->getDefinition($this->collection_service); - - foreach ($container->findTaggedServiceIds($this->service_tag) as $id => $data) + foreach ($container->findTaggedServiceIds('service_collection') as $id => $data) { - $definition->addMethodCall('add', array($id)); + $definition = $container->getDefinition($id); + + foreach ($container->findTaggedServiceIds($data['tag']) as $service_id => $service_data) + { + $definition->addMethodCall('add', array($service_id)); + } } } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 27cc4951a9..297802c210 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -112,7 +112,7 @@ $phpbb_container = phpbb_create_dumped_container_unless_debug( new phpbb_di_extension_core($phpbb_root_path), ), array( - new phpbb_di_pass_collection_pass('cron.task_collection', 'cron.task'), + new phpbb_di_pass_collection_pass(), ), $phpbb_root_path, $phpEx From 09ec65cb9b9d061d7e9c99d569a99cbe905792ca Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 12 Nov 2012 01:01:02 +0100 Subject: [PATCH 04/16] [ticket/11194] Service tag data is stored in an array so access it correctly PHPBB3-11194 --- phpBB/includes/di/pass/collection_pass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/di/pass/collection_pass.php b/phpBB/includes/di/pass/collection_pass.php index d5b82f61da..63a5c7dfc4 100644 --- a/phpBB/includes/di/pass/collection_pass.php +++ b/phpBB/includes/di/pass/collection_pass.php @@ -37,7 +37,7 @@ class phpbb_di_pass_collection_pass implements CompilerPassInterface { $definition = $container->getDefinition($id); - foreach ($container->findTaggedServiceIds($data['tag']) as $service_id => $service_data) + foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data) { $definition->addMethodCall('add', array($service_id)); } From d33aaac199bf1305d37b49a83b91a1bd014ea6cd Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 12 Nov 2012 16:16:40 -0500 Subject: [PATCH 05/16] [ticket/11195] Condense logic, remove improperly formatted if() PHPBB3-11195 --- phpBB/includes/functions_container.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 1de1d9f7ea..1763d1082a 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -126,11 +126,8 @@ function phpbb_create_dumped_container(array $extensions, array $passes, $phpbb_ function phpbb_create_dumped_container_unless_debug(array $extensions, array $passes, $phpbb_root_path, $php_ext) { - if (defined('DEBUG')) { - return phpbb_create_compiled_container($extensions, $passes, $phpbb_root_path, $php_ext); - } - - return phpbb_create_dumped_container($extensions, $passes, $phpbb_root_path, $php_ext); + $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + return $container_factory($extensions, $passes, $phpbb_root_path, $php_ext); } function phpbb_container_filename($phpbb_root_path, $php_ext) From 170967c48a583e4db5fa1131e23d7abe71681ae6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 13 Nov 2012 20:26:49 +0100 Subject: [PATCH 06/16] [ticket/10879] Remove arrow icon from attachment link in editor If you upload a file with a long filename the filename will partially cover the arrow icon background image. Remove the icon as it's not needed anyways. PHPBB3-10879 --- phpBB/styles/prosilver/template/posting_editor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 5b3f2beed0..5acdb3a08c 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -165,7 +165,7 @@
-
{attach_row.FILENAME}
+
{attach_row.FILENAME}
  From 5f15c98c1d6cce71fb94e2a36ccabd5472a4de1f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 15 Oct 2012 23:31:43 +0200 Subject: [PATCH 07/16] [ticket/11197] Prefix the css classes for the small arrow with "arrow" It does not make sense to have classes named "right" and "left" produce a small arrow next to text. It should be made clear that an arrow will appear. PHPBB3-11197 --- phpBB/styles/prosilver/template/jumpbox.html | 8 +++---- .../styles/prosilver/template/mcp_forum.html | 4 ++-- phpBB/styles/prosilver/template/mcp_logs.html | 4 ++-- .../prosilver/template/mcp_notes_user.html | 4 ++-- .../styles/prosilver/template/mcp_queue.html | 4 ++-- .../prosilver/template/mcp_reports.html | 4 ++-- .../styles/prosilver/template/mcp_whois.html | 4 ++-- .../prosilver/template/memberlist_body.html | 4 ++-- .../prosilver/template/message_body.html | 2 +- .../prosilver/template/search_results.html | 10 ++++---- .../prosilver/template/ucp_attachments.html | 4 ++-- .../template/ucp_pm_message_header.html | 2 +- .../prosilver/template/ucp_pm_viewfolder.html | 4 ++-- .../template/ucp_pm_viewmessage.html | 8 +++---- .../prosilver/template/viewforum_body.html | 4 ++-- .../prosilver/template/viewonline_body.html | 2 +- .../prosilver/template/viewtopic_body.html | 4 ++-- phpBB/styles/prosilver/theme/colours.css | 14 +++++------ phpBB/styles/prosilver/theme/links.css | 24 +++++++++---------- 19 files changed, 57 insertions(+), 57 deletions(-) diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 0060e83b15..ff234464dc 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -1,12 +1,12 @@ -

{L_RETURN_TO} {FORUM_NAME}

+

{L_RETURN_TO} {FORUM_NAME}

-

{L_RETURN_TO} {L_INDEX}

+

{L_RETURN_TO} {L_INDEX}

-

{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}

+

{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}

-

{L_RETURN_TO_SEARCH_ADV}

+

{L_RETURN_TO_SEARCH_ADV}

diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index cd4ae69fe7..e559f178f2 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -80,8 +80,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index 15974802bc..9e4a6f272e 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -54,8 +54,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index c7c568657c..3bbbd10f12 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -95,8 +95,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index dc8869713d..847151a01e 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -65,8 +65,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index f9a0ec4bd6..ea9a4edd6f 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -68,8 +68,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_whois.html b/phpBB/styles/prosilver/template/mcp_whois.html index 88d3269a71..41a825458d 100644 --- a/phpBB/styles/prosilver/template/mcp_whois.html +++ b/phpBB/styles/prosilver/template/mcp_whois.html @@ -4,11 +4,11 @@ diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 273182ec3f..4ba0c5cb2a 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -143,8 +143,8 @@
- {L_PREVIOUS} - {L_NEXT} + {L_PREVIOUS} + {L_NEXT}
diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html index fb6dfce35f..a844246055 100644 --- a/phpBB/styles/prosilver/template/message_body.html +++ b/phpBB/styles/prosilver/template/message_body.html @@ -8,7 +8,7 @@

{MESSAGE_TITLE}

{MESSAGE_TEXT}

-

{L_RETURN_TO_SEARCH_ADV}

+

{L_RETURN_TO_SEARCH_ADV}

diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 136ca991b1..62b7c61eb3 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -6,9 +6,9 @@

{L_PHRASE_SEARCH_DISABLED}

-

{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}

+

{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}

-

{L_RETURN_TO_SEARCH_ADV}

+

{L_RETURN_TO_SEARCH_ADV}

@@ -131,7 +131,7 @@ @@ -150,8 +150,8 @@
- {L_PREVIOUS} - {L_NEXT} + {L_PREVIOUS} + {L_NEXT} diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 8c93547388..478b14ab86 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -47,8 +47,8 @@
- {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index 29e6a5a46b..c47f93f739 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -18,7 +18,7 @@