Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove methods mset, mget and madd of yii\caching\Cache, getHasChanged of yii\caching\Dependency #19892

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading