We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The file cache does not work correctly if you use the prefix "en" and the key contains the word "men"
Steps to reproduce the behavior:
define('BASE_PATH', dirname(__DIR__)); use Phalcon\Cache\Adapter\Stream; use Phalcon\Cache\Cache; use Phalcon\Storage\SerializerFactory; // case 1 $adapter = new Stream(new SerializerFactory(), [ 'storageDir' => BASE_PATH . '/cache', 'prefix' => 'en', // it's not working correctly ]); $cache = new Cache($adapter); $cache->set('men', 123); $cache->set('barmen', 'abc'); $cache->set('bar', 'xyz'); var_dump($cache->get('men')); // return null var_dump($cache->get('barmen')); // return null var_dump($cache->get('bar')); // return 'xyz' var_dump($adapter->getKeys()); // case 2 $adapter = new Stream(new SerializerFactory(), [ 'storageDir' => BASE_PATH . '/cache', 'prefix' => 'eng', ]); $cache = new Cache($adapter); $cache->set('men', 123); $cache->set('barmen', 'abc'); $cache->set('bar', 'xyz'); var_dump($cache->get('men')); // return 123 var_dump($cache->get('barmen')); // return 'abc' var_dump($cache->get('bar')); // return 'xyz' var_dump($adapter->getKeys());
Expected behavior I expect to get the value 123 with the prefix "en" and the key "men"
$adapter = new Stream(new SerializerFactory(), [ 'storageDir' => BASE_PATH . '/cache', 'prefix' => 'en', ]); var_dump($cache->get('men')); // return 123 var_dump($cache->get('barmen')); // return 'abc'
Details
The text was updated successfully, but these errors were encountered:
Phalcon version: 5.2.1 PHP Version: 8.2 Operating System: maxOs
# case 1 NULL NULL string(3) "xyz" array(3) { [0]=> string(5) "enbar" [1]=> string(8) "enbarmen" [2]=> string(5) "enmen" } # case 2 int(123) string(3) "abc" string(3) "xyz" array(3) { [0]=> string(6) "engbar" [1]=> string(9) "engbarmen" [2]=> string(6) "engmen" }
Sorry, something went wrong.
Resolved in #16349
Thank you @davidbayra and @yesworld for the report and examples.
niden
Successfully merging a pull request may close this issue.
The file cache does not work correctly if you use the prefix "en" and the key contains the word "men"
Steps to reproduce the behavior:
Expected behavior
I expect to get the value 123 with the prefix "en" and the key "men"
Details
The text was updated successfully, but these errors were encountered: