beryllium / cachebundle Goto Github PK
View Code? Open in Web Editor NEWSymfony2 bundle for memcache and other caching interfaces
License: MIT License
Symfony2 bundle for memcache and other caching interfaces
License: MIT License
Hello,
I'd like to use this bundle for memcachier but the protocol uses user/password credentials.
There is a documentation here : https://devcenter.heroku.com/articles/memcachier#php
Thanks.
Hi Jeremy,
I thought it would be nice to be able to take advantage of memcached multiget functionality. In current implementation multiget (I give array of keys to get function) fails because of "$key = $this->prefix . $key;" line.
public function get($key)
{
if ($this->isSafe()) {
$key = $this->prefix . $key;
return $this->mem->get($key);
}
return false;
}
Something like below should do the work, I guess. Please let me know what you think.
public function get($key)
{
if ($this->isSafe()) {
if (is_array($key)) {
if ($this->prefix != '') {
for ($i = 0; $i < count($key); $i++) {
$key[$i] = $this->prefix . $key[$i];
}
}
}
else {
$key = $this->prefix . $key;
}
return $this->mem->get($key);
}
return false;
}
I think that the bundle should be changed to use Memcache's existing getServerStatus() function to check the availability of a server.
See the following StackOverflow thread: http://stackoverflow.com/questions/2891868/php-memcache-check-if-any-server-is-available-in-pool
It seems that fsockopen throws a PHP warning when the server times out. Since these situations are handled by the code, the warning ends up being noise for any logs that you are monitoring.
I can make this change and submit a PR if you're open to it. I just wanted to check first.
Thanks!
Seems I don't have a parameters.ini so I'm not sure where this should go?
I was thinking you meant parameters.yml, but I'm not sure what you're expecting for the container name:
e.g. (parameters.yml):
memcache:
beryllium_cache.client.servers["127.0.0.1"] = 11211
Thanks!
subj, make please method to delete element from memcache
When pulling down committed code that includes both the completed composer.json reference and the bundle's instantiation in AppKernel, running composer update on a new git cloned directory results in:
PHP Fatal error: Class 'Beryllium\CacheBundle\BerylliumCacheBundle' not found in /home/vagrant/CPH/cph-api-services/app/AppKernel.php on line 36
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
I have tried running composer update and composer install with the --no-scripts options, but this only results in symfony2 not properly installing this bundle.
The main idea of automating this git pull and run with it approach in my case, is so that other people can run my vagrant machine and run one or two commands and be off to the races. With this bundle, I run into a rather big snag. Is there a way I can shell script around the problem or provide the proper instructions?
First of all thanks for the bundle.
I think touch&gat are helpful features/interfaces and it will be very easy to implement.
Are you planning to add them?
If you want I can add as well?
The Memcache client should log cases where a connection attempt fails. The logger should be an optional dependency for the client and should implement Psr\Log\LoggerInterface.
I can add this enhancement, but I wanted to add it to the issue list as a placeholder.
Needs to be fleshed out and unit tested.
While running PHPUnit tests got current error:
Caused by
Symfony\Component\Yaml\Exception\ParseException: The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 14 (near "arguments: [@beryllium_cache.client.memcache]").
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFileLoader.php:355
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Loader\YamlFileLoader.php:44
E:\restapi\vendor\Beryllium\CacheBundle\Beryllium\CacheBundle\DependencyInjection\BerylliumCacheExtension.php:26
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass.php:55
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass.php:39
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php:107
E:\restapi\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php:589
E:\restapi\app\bootstrap.php.cache:2687
E:\restapi\app\bootstrap.php.cache:2465
E:\restapi\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php:142
E:\restapi\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\WebTestCase.php:33
Can you quote all parameters in service.yml started from @
For example:
arguments: [@beryllium_cache.client.memcache]
change to
arguments: ['@beryllium_cache.client.memcache']
It really helps. Thank you.
It's important to be able to break the cache by
and
I can't find any way to do either. Maybe just missing from the documentation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.