-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
\Phalcon\Cache\Backend\File -> queryKeys #14190
Comments
@Kzmxewsy Not sure why this was designed this way but the whole cache namespace has been refactored to implement PSR-16. Can you test your code with v4? |
@niden I have tested it with v4.0.0-alpha.5,But I am not familiar with v4, the code is below function reproduce()
{
$cache = new \Phalcon\Cache\Adapter\Stream(
new Phalcon\Storage\SerializerFactory([
"lifetime" => 86400,
]), [
"prefix" => 'test',
"cacheDir" => 'cache',
]
);
$prefix = 'my-prefix';
foreach (range('a', 'z') as $key => $value) {
$key = $prefix . '.' . $key;
$cache->set($key, $value);
}
$allKeys = $cache->getKeys($prefix);
print_r($allKeys);
$fail = 0;
if ($allKeys) {
foreach ($allKeys as $delKey) {
// It does't work,because the result of queryKeys is contained prefix=>test
$cache->delete($delKey) || $fail++;
}
}
print_r($fail);
exit;
} Although the cached file structure is different, the result is the same as v3. |
@Kzmxewsy Thanks will check that. |
Resolved in #14211 |
Hello, strictly speaking, I don't know if this is a bug, because It's easy to fix, is it designed to be like this originally?
Details
php --ri phalcon
) v3.4.3php -v
) PHP 7.2.17 x64 TSThe text was updated successfully, but these errors were encountered: