sonata-project / cache Goto Github PK
View Code? Open in Web Editor NEW[Deprecated] Cache library
Home Page: https://github.com/sonata-project/cache
License: MIT License
[Deprecated] Cache library
Home Page: https://github.com/sonata-project/cache
License: MIT License
Symfony 3.1 now has it own cache component: http://symfony.com/blog/new-in-symfony-3-1-cache-component
Maybe it will be better to deprecate this project and make cache-bundle relying on the Symfony component?
cc @rande @sonata-project/contributors
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
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?
Ref: http://www.php-fig.org/psr/psr-6/
Wait #49 before working on it.
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
$ composer show --latest 'sonata-project/*'
# Put the result here.
$ composer show --latest 'symfony/*'
# Put the result here.
$ php -v
# Put the result here.
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)));
}
Just run anything that instantiates and uses Memcached Adapter, and you'll endup with Fatal Error for Php 7+
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
If you want to use the mongo driver you need to install the pecl mongo extension first (https://secure.php.net/manual/en/mongo.installation.php) which is not available with PHP 7.
And this extension is deprecated and the documentation recommend to use the MongoDB extension (https://php.net/manual/en/set.mongodb.php).
As the following PR (which is merged) sonata-project/SonataCacheBundle#63 uses the new UnsupportedException
class, you have to create a new sonata-project/cache
because actually there is an error.
Thank you!
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.