Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/250296

Change subject: HashBagOStuff: allow initial data to be specified on 
instantiation
......................................................................

HashBagOStuff: allow initial data to be specified on instantiation

If the array of parameters that is passed to the HashBagOStuff constructors
contains an 'initialData' parameter, it is used as the internal array the
HashBagOStuff uses for storage.

Change-Id: Ibf11bf2846a2f9d4e95a31c206ad4911c8c384c7
---
M includes/libs/objectcache/HashBagOStuff.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/250296/1

diff --git a/includes/libs/objectcache/HashBagOStuff.php 
b/includes/libs/objectcache/HashBagOStuff.php
index 94bc95f..132df60 100644
--- a/includes/libs/objectcache/HashBagOStuff.php
+++ b/includes/libs/objectcache/HashBagOStuff.php
@@ -33,7 +33,9 @@
 
        function __construct( $params = array() ) {
                parent::__construct( $params );
-               $this->bag = array();
+               $this->bag = isset( $params['initialData'] )
+                       ? $params['initialData']
+                       : array();
        }
 
        protected function expire( $key ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/250296
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf11bf2846a2f9d4e95a31c206ad4911c8c384c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to