diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/objectcache/HashBagOStuff.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/objectcache/HashBagOStuff.php')
-rw-r--r-- | includes/objectcache/HashBagOStuff.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/includes/objectcache/HashBagOStuff.php b/includes/objectcache/HashBagOStuff.php index d061eff0..6e50a8c3 100644 --- a/includes/objectcache/HashBagOStuff.php +++ b/includes/objectcache/HashBagOStuff.php @@ -28,14 +28,15 @@ * @ingroup Cache */ class HashBagOStuff extends BagOStuff { - var $bag; + /** @var array */ + protected $bag; function __construct() { $this->bag = array(); } /** - * @param $key string + * @param string $key * @return bool */ protected function expire( $key ) { @@ -51,8 +52,8 @@ class HashBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $casToken[optional] mixed + * @param string $key + * @param mixed $casToken [optional] * @return bool|mixed */ function get( $key, &$casToken = null ) { @@ -64,15 +65,15 @@ class HashBagOStuff extends BagOStuff { return false; } - $casToken = $this->bag[$key][0]; + $casToken = serialize( $this->bag[$key][0] ); return $this->bag[$key][0]; } /** - * @param $key string - * @param $value mixed - * @param $exptime int + * @param string $key + * @param mixed $value + * @param int $exptime * @return bool */ function set( $key, $value, $exptime = 0 ) { @@ -81,14 +82,14 @@ class HashBagOStuff extends BagOStuff { } /** - * @param $casToken mixed - * @param $key string - * @param $value mixed - * @param $exptime int + * @param mixed $casToken + * @param string $key + * @param mixed $value + * @param int $exptime * @return bool */ function cas( $casToken, $key, $value, $exptime = 0 ) { - if ( $this->get( $key ) === $casToken ) { + if ( serialize( $this->get( $key ) ) === $casToken ) { return $this->set( $key, $value, $exptime ); } @@ -96,8 +97,8 @@ class HashBagOStuff extends BagOStuff { } /** - * @param $key string - * @param $time int + * @param string $key + * @param int $time * @return bool */ function delete( $key, $time = 0 ) { |