Git Product home page Git Product logo

cache's People

Contributors

bladrak avatar core23 avatar dbu avatar franmomu avatar greg0ire avatar jlamur avatar jordisala1991 avatar mremi avatar nanofelis avatar oskarstark avatar pborreli avatar rande avatar ryzy avatar shehabic avatar sonataci avatar soullivaneuh avatar vincentlanglet avatar xleliberty avatar yanshuoh 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  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  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  avatar  avatar  avatar  avatar

Watchers

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

cache's Issues

ISP violations

Looking at the implementations of cache adapter show code smells revealing several ISP violations:

These methods should be extracted to separate interfaces, and implementing them should be optional.

Likewise, the isContextual method should be removed and replaced with a marker interface. https://github.com/sonata-project/SonataCacheBundle/blob/2.x/src/Adapter/SymfonyCache.php#L229-L232

ApcCache - The count of exploded ipv4 should be 4

Hello,

I've recently got a problem of socket_create as follow:

ContextErrorException: Warning: socket_create(): Unable to create socket [97]: Address family not supported by protocol in .../vendor/sonata-project/cache/lib/Adapter/Cache/ApcCache.php line 84

It seems that this is due to the following line (line 80: Adapter/Cache/ApcCache.php):

if (count(explode('.', $server['ip'])) == 3) {
                $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
} else {
                $socket = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
}

It should be a count of 4 for ipv4?

ApcCache error

PHP Catchable fatal error: Argument 3 passed to Sonata\Cache\Adapter\Cache\ApcCache::__construct() must be of the type array, string given, called in /home/kaiba/NetBeansProjects/siig/app/cache/dev/appDevDebugProjectContainer.php on line 5343 and defined in /home/kaiba/NetBeansProjects/siig/vendor/sonata-project/cache/lib/Adapter/Cache/ApcCache.php on line 44

Memcached Adapter is not conforming to CacheAdapterInterface

Environment

Sonata packages

$ composer show --latest 'sonata-project/*'
# Put the result here.

Symfony packages

$ composer show --latest 'symfony/*'
# Put the result here.

PHP version

$ php -v
# Put the result here.

Subject

Memcached Adapter is not conforming to CacheAdapterInterface
the following:

    /**
     * {@inheritdoc}
     */
    public function get(array $keys)
    {
        return $this->handleGet($keys, $this->getCollection()->get($this->computeCacheKeys($keys)));
    }

should be:

    /**
     * {@inheritdoc}
     */
    public function get(array $keys): CacheElementInterface
    {
        return $this->handleGet($keys, $this->getCollection()->get($this->computeCacheKeys($keys)));
    }

Steps to reproduce

Just run anything that instantiates and uses Memcached Adapter, and you'll endup with Fatal Error for Php 7+

Expected results

Actual results

Implement contextualKeys for redis

Hi guys,

While it's possible to implement contextualKeys for redis (any key-value backend) by create a key - value for each context, i'm not sure if it's a bad approach.

For example:
Consider 2 objects

$post1 = array(
    'id' => array('blogId'=>1,'type'=>'view),
    'contexts' => array('authorId'=> 1,'imageId' => 2)
);
$post2 = array(
    'id' => array('blogId'=>2,'type'=>'view),
    'contexts' => array('authorId'=> 1,'imageId' => 3)
);

We could create 3 entries in redis for contextualKeys

authorId1 => [post1,post2]
imageId2 => [post1]
imageId3 => [post2]

I created small js lib follow this approach, i'm not sure if this approach is bad
https://github.com/hoangnd25/cacheJS

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.