aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/di/ordered_service_collection.php
diff options
context:
space:
mode:
authorMate Bartus <mate.bartus@gmail.com>2015-06-27 12:49:10 +0200
committerMate Bartus <mate.bartus@gmail.com>2015-06-27 12:49:10 +0200
commitc80cf87b90eefab664ecf69f29796f9390a3ff17 (patch)
tree80106695200bf1cb34108e0d63d948dbcd11107f /phpBB/phpbb/di/ordered_service_collection.php
parentb09293d5ff38633d506083cffc0a9dd2c98c15c4 (diff)
downloadforums-c80cf87b90eefab664ecf69f29796f9390a3ff17.tar
forums-c80cf87b90eefab664ecf69f29796f9390a3ff17.tar.gz
forums-c80cf87b90eefab664ecf69f29796f9390a3ff17.tar.bz2
forums-c80cf87b90eefab664ecf69f29796f9390a3ff17.tar.xz
forums-c80cf87b90eefab664ecf69f29796f9390a3ff17.zip
[ticket/13961] Allow the collection to be modified runtime
PHPBB3-13961
Diffstat (limited to 'phpBB/phpbb/di/ordered_service_collection.php')
-rw-r--r--phpBB/phpbb/di/ordered_service_collection.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/phpBB/phpbb/di/ordered_service_collection.php b/phpBB/phpbb/di/ordered_service_collection.php
index 46f397a004..046012ae5b 100644
--- a/phpBB/phpbb/di/ordered_service_collection.php
+++ b/phpBB/phpbb/di/ordered_service_collection.php
@@ -90,14 +90,9 @@ class ordered_service_collection extends service_collection
*/
public function add($service_id, $order = 0)
{
- if ($this->is_ordered)
- {
- return;
- }
-
$order = (int) $order;
-
$this->service_ids[$order][] = $service_id;
+ $this->is_ordered = false;
}
protected function sort_services()
@@ -107,6 +102,7 @@ class ordered_service_collection extends service_collection
return;
}
+ $this->exchangeArray(array());
ksort($this->service_ids);
foreach ($this->service_ids as $service_order_group)
{