Git Product home page Git Product logo

cachebundle's People

Contributors

beryllium avatar gezpage avatar gierschv avatar jeremylivingston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cachebundle's Issues

Multiget

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;
}

Use Memcache::getServerStatus() instead of fsockopen()

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!

Where can I ask questions about CacheBundle?

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!

AppKernel vs. Composer update circular problem

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?

Touch&Gat

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?

Add Logging to Memcache Client

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.

The reserved indicator "@" cannot start a plain scalar

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.

No obvious way to break the cache

It's important to be able to break the cache by

  1. deleting specific entries by key

and

  1. deleting multiple entries by namespace

I can't find any way to do either. Maybe just missing from the documentation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.