From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/objectcache/HashBagOStuff.php | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 includes/objectcache/HashBagOStuff.php (limited to 'includes/objectcache/HashBagOStuff.php') diff --git a/includes/objectcache/HashBagOStuff.php b/includes/objectcache/HashBagOStuff.php new file mode 100644 index 00000000..36773306 --- /dev/null +++ b/includes/objectcache/HashBagOStuff.php @@ -0,0 +1,58 @@ +bag = array(); + } + + protected function expire( $key ) { + $et = $this->bag[$key][1]; + + if ( ( $et == 0 ) || ( $et > time() ) ) { + return false; + } + + $this->delete( $key ); + + return true; + } + + function get( $key ) { + if ( !isset( $this->bag[$key] ) ) { + return false; + } + + if ( $this->expire( $key ) ) { + return false; + } + + return $this->bag[$key][0]; + } + + function set( $key, $value, $exptime = 0 ) { + $this->bag[$key] = array( $value, $this->convertExpiry( $exptime ) ); + } + + function delete( $key, $time = 0 ) { + if ( !isset( $this->bag[$key] ) ) { + return false; + } + + unset( $this->bag[$key] ); + + return true; + } + + function keys() { + return array_keys( $this->bag ); + } +} + -- cgit v1.2.3-54-g00ecf