Aaron Schulz has uploaded a new change for review.

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

Change subject: Removed unused and poorly supported time argument to 
BagOStuff::delete
......................................................................

Removed unused and poorly supported time argument to BagOStuff::delete

Change-Id: I8f90f480ec8bc70605c85c39f73f29df21d1927d
---
M includes/objectcache/APCBagOStuff.php
M includes/objectcache/BagOStuff.php
M includes/objectcache/EmptyBagOStuff.php
M includes/objectcache/HashBagOStuff.php
M includes/objectcache/MemcachedBagOStuff.php
M includes/objectcache/MemcachedPeclBagOStuff.php
M includes/objectcache/MultiWriteBagOStuff.php
M includes/objectcache/RedisBagOStuff.php
M includes/objectcache/SqlBagOStuff.php
M includes/objectcache/WinCacheBagOStuff.php
M includes/objectcache/XCacheBagOStuff.php
11 files changed, 14 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/186914/1

diff --git a/includes/objectcache/APCBagOStuff.php 
b/includes/objectcache/APCBagOStuff.php
index d879ca8..598692e 100644
--- a/includes/objectcache/APCBagOStuff.php
+++ b/includes/objectcache/APCBagOStuff.php
@@ -79,10 +79,9 @@
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
                apc_delete( $key );
 
                return true;
diff --git a/includes/objectcache/BagOStuff.php 
b/includes/objectcache/BagOStuff.php
index 0a23446..1a4514d 100644
--- a/includes/objectcache/BagOStuff.php
+++ b/includes/objectcache/BagOStuff.php
@@ -58,9 +58,6 @@
                $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 @@
        /**
         * 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).
diff --git a/includes/objectcache/EmptyBagOStuff.php 
b/includes/objectcache/EmptyBagOStuff.php
index 9595b83..dbc57b9 100644
--- a/includes/objectcache/EmptyBagOStuff.php
+++ b/includes/objectcache/EmptyBagOStuff.php
@@ -60,10 +60,9 @@
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       function delete( $key, $time = 0 ) {
+       function delete( $key ) {
                return true;
        }
 
diff --git a/includes/objectcache/HashBagOStuff.php 
b/includes/objectcache/HashBagOStuff.php
index 06a0865..08bb1f9 100644
--- a/includes/objectcache/HashBagOStuff.php
+++ b/includes/objectcache/HashBagOStuff.php
@@ -98,10 +98,9 @@
 
        /**
         * @param string $key
-        * @param int $time
         * @return bool
         */
-       function delete( $key, $time = 0 ) {
+       function delete( $key ) {
                if ( !isset( $this->bag[$key] ) ) {
                        return false;
                }
diff --git a/includes/objectcache/MemcachedBagOStuff.php 
b/includes/objectcache/MemcachedBagOStuff.php
index 0e133a8..9e62610 100644
--- a/includes/objectcache/MemcachedBagOStuff.php
+++ b/includes/objectcache/MemcachedBagOStuff.php
@@ -91,11 +91,10 @@
 
        /**
         * @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 ) );
        }
 
        /**
diff --git a/includes/objectcache/MemcachedPeclBagOStuff.php 
b/includes/objectcache/MemcachedPeclBagOStuff.php
index 7c0a645..913f9e3 100644
--- a/includes/objectcache/MemcachedPeclBagOStuff.php
+++ b/includes/objectcache/MemcachedPeclBagOStuff.php
@@ -151,12 +151,11 @@
 
        /**
         * @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;
diff --git a/includes/objectcache/MultiWriteBagOStuff.php 
b/includes/objectcache/MultiWriteBagOStuff.php
index 04ed894..4b67816 100644
--- a/includes/objectcache/MultiWriteBagOStuff.php
+++ b/includes/objectcache/MultiWriteBagOStuff.php
@@ -99,11 +99,10 @@
 
        /**
         * @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 );
        }
 
        /**
diff --git a/includes/objectcache/RedisBagOStuff.php 
b/includes/objectcache/RedisBagOStuff.php
index 6836f74..8e4fa4d 100644
--- a/includes/objectcache/RedisBagOStuff.php
+++ b/includes/objectcache/RedisBagOStuff.php
@@ -147,7 +147,7 @@
                return $result;
        }
 
-       public function delete( $key, $time = 0 ) {
+       public function delete( $key ) {
 
                list( $server, $conn ) = $this->getConnection( $key );
                if ( !$conn ) {
diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index 7524240..6c06cb5 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -446,10 +446,9 @@
 
        /**
         * @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 );
diff --git a/includes/objectcache/WinCacheBagOStuff.php 
b/includes/objectcache/WinCacheBagOStuff.php
index 78a512c..8a71b88 100644
--- a/includes/objectcache/WinCacheBagOStuff.php
+++ b/includes/objectcache/WinCacheBagOStuff.php
@@ -81,10 +81,9 @@
         * 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;
diff --git a/includes/objectcache/XCacheBagOStuff.php 
b/includes/objectcache/XCacheBagOStuff.php
index d7603b1..10baee0 100644
--- a/includes/objectcache/XCacheBagOStuff.php
+++ b/includes/objectcache/XCacheBagOStuff.php
@@ -85,10 +85,9 @@
         * 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;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f90f480ec8bc70605c85c39f73f29df21d1927d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to