Removed unused and poorly supported time argument to BagOStuff::delete
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Jan 2015 01:14:33 +0000 (17:14 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Jan 2015 01:14:33 +0000 (17:14 -0800)
Change-Id: I8f90f480ec8bc70605c85c39f73f29df21d1927d

includes/objectcache/APCBagOStuff.php
includes/objectcache/BagOStuff.php
includes/objectcache/EmptyBagOStuff.php
includes/objectcache/HashBagOStuff.php
includes/objectcache/MemcachedBagOStuff.php
includes/objectcache/MemcachedPeclBagOStuff.php
includes/objectcache/MultiWriteBagOStuff.php
includes/objectcache/RedisBagOStuff.php
includes/objectcache/SqlBagOStuff.php
includes/objectcache/WinCacheBagOStuff.php
includes/objectcache/XCacheBagOStuff.php

index d879ca8..598692e 100644 (file)
@@ -79,10 +79,9 @@ class APCBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                apc_delete( $key );
 
                return true;
index 0a23446..1a4514d 100644 (file)
@@ -58,9 +58,6 @@ abstract class BagOStuff {
                $this->debugMode = $bool;
        }
 
-       /* *** THE GUTS OF THE OPERATION *** */
-       /* Override these with functional things in subclasses */
-
        /**
         * Get an item with the given key. Returns false if it does not exist.
         * @param string $key
@@ -91,10 +88,9 @@ abstract class BagOStuff {
        /**
         * Delete an item.
         * @param string $key
-        * @param int $time Amount of time to delay the operation (mostly memcached-specific)
         * @return bool True if the item was deleted or not found, false on failure
         */
-       abstract public function delete( $key, $time = 0 );
+       abstract public function delete( $key );
 
        /**
         * Merge changes into the existing cache value (possibly creating a new one).
index 9595b83..dbc57b9 100644 (file)
@@ -60,10 +60,9 @@ class EmptyBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       function delete( $key, $time = 0 ) {
+       function delete( $key ) {
                return true;
        }
 
index 06a0865..08bb1f9 100644 (file)
@@ -98,10 +98,9 @@ class HashBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       function delete( $key, $time = 0 ) {
+       function delete( $key ) {
                if ( !isset( $this->bag[$key] ) ) {
                        return false;
                }
index 0e133a8..9e62610 100644 (file)
@@ -91,11 +91,10 @@ class MemcachedBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
-               return $this->client->delete( $this->encodeKey( $key ), $time );
+       public function delete( $key ) {
+               return $this->client->delete( $this->encodeKey( $key ) );
        }
 
        /**
index 7c0a645..913f9e3 100644 (file)
@@ -151,12 +151,11 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                $this->debugLog( "delete($key)" );
-               $result = parent::delete( $key, $time );
+               $result = parent::delete( $key );
                if ( $result === false && $this->client->getResultCode() === Memcached::RES_NOTFOUND ) {
                        // "Not found" is counted as success in our interface
                        return true;
index 04ed894..4b67816 100644 (file)
@@ -99,11 +99,10 @@ class MultiWriteBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
-               return $this->doWrite( 'delete', $key, $time );
+       public function delete( $key ) {
+               return $this->doWrite( 'delete', $key );
        }
 
        /**
index 6836f74..8e4fa4d 100644 (file)
@@ -147,7 +147,7 @@ class RedisBagOStuff extends BagOStuff {
                return $result;
        }
 
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
 
                list( $server, $conn ) = $this->getConnection( $key );
                if ( !$conn ) {
index 7524240..6c06cb5 100644 (file)
@@ -446,10 +446,9 @@ class SqlBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                list( $serverIndex, $tableName ) = $this->getTableByKey( $key );
                try {
                        $db = $this->getDB( $serverIndex );
index 78a512c..8a71b88 100644 (file)
@@ -81,10 +81,9 @@ class WinCacheBagOStuff extends BagOStuff {
         * Remove a value from the WinCache object cache
         *
         * @param string $key Cache key
-        * @param int $time Not used in this implementation
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                wincache_ucache_delete( $key );
 
                return true;
index d7603b1..10baee0 100644 (file)
@@ -85,10 +85,9 @@ class XCacheBagOStuff extends BagOStuff {
         * Remove a value from the XCache object cache
         *
         * @param string $key Cache key
-        * @param int $time Not used in this implementation
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                xcache_unset( $key );
                return true;
        }