Merge "Removed unused and poorly supported time argument to BagOStuff::delete"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 5 Feb 2015 02:28:01 +0000 (02:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Feb 2015 02:28:01 +0000 (02:28 +0000)
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 ae49564..c8c3497 100644 (file)
@@ -83,9 +83,6 @@ abstract class BagOStuff implements LoggerAwareInterface {
                $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
@@ -116,10 +113,9 @@ abstract class BagOStuff implements LoggerAwareInterface {
        /**
         * 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 6da1882..a466282 100644 (file)
@@ -99,10 +99,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 6a98a8a..2b0efa9 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 4ead417..339a536 100644 (file)
@@ -152,12 +152,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 dbaccd6..b5333fd 100644 (file)
@@ -100,11 +100,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 fef7155..93cdae3 100644 (file)
@@ -148,7 +148,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 2a92bee..98cb284 100644 (file)
@@ -447,10 +447,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;
        }