Fixed some cache issues (#1557)

* Fixed some cache issues

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-07-22 17:58:38 +07:00 committed by GitHub
commit db19ca6ecc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 11 additions and 11 deletions

View file

@ -8,7 +8,7 @@
- Release 2.4.4 🦩 ([belomaxorka](https://github.com/belomaxorka))
- Supports PHP 8.2 / PHP 8.3 ([belomaxorka](https://github.com/belomaxorka))
- CWE-502 Fixed: Deserialization of untrusted data ([belomaxorka](https://github.com/belomaxorka))
- Refactored cache drivers 🗃 [\#1553](https://github.com/torrentpier/torrentpier/pull/1553) ([belomaxorka](https://github.com/belomaxorka))
- Refactored cache drivers 🗃 [\#1553](https://github.com/torrentpier/torrentpier/pull/1553), [\#1557](https://github.com/torrentpier/torrentpier/pull/1557) ([belomaxorka](https://github.com/belomaxorka))
- Create tech stack docs (techstack.yml and techstack.md) [\#1521](https://github.com/torrentpier/torrentpier/pull/1521), [\#1522](https://github.com/torrentpier/torrentpier/pull/1522) ([belomaxorka](https://github.com/belomaxorka))
- Added MonsterID avatars support 🎇 [\#1546](https://github.com/torrentpier/torrentpier/pull/1546) ([belomaxorka](https://github.com/belomaxorka))
- Added ability to reset ratio [\#1545](https://github.com/torrentpier/torrentpier/pull/1545) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -114,9 +114,9 @@ class APCu extends Common
public function rm(string $name = null): bool
{
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? ("'" . $this->prefix . $name . "'") : null;
$name = is_string($name) ? $this->prefix . $name : null;
$this->cur_query = "cache->$targetMethod($name)";
$this->cur_query = "cache->$targetMethod('$name')";
$this->debug('start');
$result = $this->apcu->$targetMethod($name);

View file

@ -119,9 +119,9 @@ class File extends Common
public function rm(string $name = null): bool
{
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? ("'" . $this->prefix . $name . "'") : null;
$name = is_string($name) ? $this->prefix . $name : null;
$this->cur_query = "cache->$targetMethod($name)";
$this->cur_query = "cache->$targetMethod('$name')";
$this->debug('start');
$result = $this->file->$targetMethod($name);

View file

@ -174,9 +174,9 @@ class Memcached extends Common
}
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? ("'" . $this->prefix . $name . "'") : null;
$name = is_string($name) ? $this->prefix . $name : null;
$this->cur_query = "cache->$targetMethod($name)";
$this->cur_query = "cache->$targetMethod('$name')";
$this->debug('start');
$result = $this->memcached->$targetMethod($name);

View file

@ -176,9 +176,9 @@ class Redis extends Common
}
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? ("'" . $this->prefix . $name . "'") : null;
$name = is_string($name) ? $this->prefix . $name : null;
$this->cur_query = "cache->$targetMethod($name)";
$this->cur_query = "cache->$targetMethod('$name')";
$this->debug('start');
$result = $this->redis->$targetMethod($name);

View file

@ -117,9 +117,9 @@ class Sqlite extends Common
public function rm(string $name = null): bool
{
$targetMethod = is_string($name) ? 'delete' : 'flush';
$name = is_string($name) ? ("'" . $this->prefix . $name . "'") : null;
$name = is_string($name) ? $this->prefix . $name : null;
$this->cur_query = "cache->$targetMethod($name)";
$this->cur_query = "cache->$targetMethod('$name')";
$this->debug('start');
$result = $this->sqlite->$targetMethod($name);