Skip to content

Commit

Permalink
Remove methods mset, mget and madd of yii\caching\Cache, getHasChan…
Browse files Browse the repository at this point in the history
…ged of `yii\caching\Dependency` (#19892)
  • Loading branch information
jiaweipan committed Jul 13, 2023
1 parent 0a3394c commit 9a5e2a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
53 changes: 0 additions & 53 deletions framework/caching/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,6 @@ public function exists($key)
return $value !== false;
}

/**
* Retrieves multiple values from cache with the specified keys.
* Some caches (such as memcache, apc) allow retrieving multiple cached values at the same time,
* which may improve the performance. In case a cache does not support this feature natively,
* this method will try to simulate it.
*
* @param string[] $keys list of string keys identifying the cached values
* @return array list of cached values corresponding to the specified keys. The array
* is returned in terms of (key, value) pairs.
* If a value is not cached or expired, the corresponding array value will be false.
* @deprecated This method is an alias for [[multiGet()]] and will be removed in 2.1.0.
*/
public function mget($keys)
{
return $this->multiGet($keys);
}

/**
* Retrieves multiple values from cache with the specified keys.
* Some caches (such as memcache, apc) allow retrieving multiple cached values at the same time,
Expand Down Expand Up @@ -255,25 +238,6 @@ public function set($key, $value, $duration = null, $dependency = null)
return $this->setValue($key, $value, $duration);
}

/**
* Stores multiple items in cache. Each item contains a value identified by a key.
* If the cache already contains such a key, the existing value and
* expiration time will be replaced with the new ones, respectively.
*
* @param array $items the items to be cached, as key-value pairs.
* @param int|null $duration default duration in seconds before the cache will expire. If not set,
* default [[defaultDuration]] value is used.
* @param Dependency|null $dependency dependency of the cached items. If the dependency changes,
* the corresponding values in the cache will be invalidated when it is fetched via [[get()]].
* This parameter is ignored if [[serializer]] is false.
* @return array array of failed keys
* @deprecated This method is an alias for [[multiSet()]] and will be removed in 2.1.0.
*/
public function mset($items, $duration = null, $dependency = null)
{
return $this->multiSet($items, $duration, $dependency);
}

/**
* Stores multiple items in cache. Each item contains a value identified by a key.
* If the cache already contains such a key, the existing value and
Expand Down Expand Up @@ -313,23 +277,6 @@ public function multiSet($items, $duration = null, $dependency = null)
return $this->setValues($data, $duration);
}

/**
* Stores multiple items in cache. Each item contains a value identified by a key.
* If the cache already contains such a key, the existing value and expiration time will be preserved.
*
* @param array $items the items to be cached, as key-value pairs.
* @param int $duration default number of seconds in which the cached values will expire. 0 means never expire.
* @param Dependency|null $dependency dependency of the cached items. If the dependency changes,
* the corresponding values in the cache will be invalidated when it is fetched via [[get()]].
* This parameter is ignored if [[serializer]] is false.
* @return array array of failed keys
* @deprecated This method is an alias for [[multiAdd()]] and will be removed in 2.1.0.
*/
public function madd($items, $duration = 0, $dependency = null)
{
return $this->multiAdd($items, $duration, $dependency);
}

/**
* Stores multiple items in cache. Each item contains a value identified by a key.
* If the cache already contains such a key, the existing value and expiration time will be preserved.
Expand Down
11 changes: 0 additions & 11 deletions framework/caching/Dependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ public function evaluateDependency($cache)
}
}

/**
* Returns a value indicating whether the dependency has changed.
* @deprecated since version 2.0.11. Will be removed in version 2.1. Use [[isChanged()]] instead.
* @param CacheInterface $cache the cache component that is currently evaluating this dependency
* @return bool whether the dependency has changed.
*/
public function getHasChanged($cache)
{
return $this->isChanged($cache);
}

/**
* Checks whether the dependency is changed.
* @param CacheInterface $cache the cache component that is currently evaluating this dependency
Expand Down

0 comments on commit 9a5e2a5

Please sign in to comment.