--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
-- pmj
Yes, the suggestion is to remove that one interface :)
2013/5/16 Marco Pivetta <ocra...@gmail.com>Yes, the suggestion is to remove that one interface :)+1
--
Hey Marco,We have it for Psr\Log - https://github.com/php-fig/log/blob/master/Psr/Log/LoggerAwareInterface.phpWe should remain consistent.
What is, in your opinion, the bad practice being followed here? Setter injection? If so, I would disagree with you there and say that it is neither bad nor good. It's an optional type of implementation and a completely valid approach.
With the caching proposal, *nobody* has a variation of it in place yet.
...
> • SugarCRM - ???
This document indicates they have one: <http://developers.sugarcrm.com/wordpress/2011/08/30/deciphering-the-sugarcrm-cache-directory/>
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
On 05/16/2013 09:25 AM, Marco Pivetta wrote:And yes, it's a bad practice.
At least half of my debugging time goes in missed setter injection somewhere, not to mention answering questions by users (in the communities I follow) who apply the initializer pattern in wrong ways or expect it to be magic.
Also, cache usually isn't not a soft dependency (we use null caches to achieve that).
I disagree entirely. There's nothing wrong with setter injection if used correctly. It can actually help with automation quite a bit if you have a factory or DI container that is spawning objects. It can check if an object implements an "aware" interface, and if so give it what it needs. Symfony is doing that in a few places, Drupal is doing it in a few places, PSR-3 has it... Keep it in.
On May 15, 2013, at 6:47 PM, Paul Dragoonis wrote:
> If nobody has any changes to make then I'm going to call up a vote on this within the next few weeks.
One addition: there needs to be a survey of the existing member cache systems that shows how they currently operate, similar to how a survey was done for PSR-1, PSR-2, and PSR-3.
If the proposed cache ends up being wildly different from those, then I'd suggest the proposal would need to be modified (but wait and see -- it might be close indeed).
-- pmj
I think `increment()` should be part of the interface too.
If I build a library based on the cache and I use `PSR/Cache`, I will only rely on the interface for interoperability. If I have to increment/decrement interger value I will have to reimplment these methods with `get()` + `set()`. It's a performance issue (2 requests instead of 1). Caching is all about performance.
Of course, interface is the "minimal contract" of the backend which could implement these methods, but if I have to check if backend class supports or not incrementing, the interface does not fulfill its role.
Furthemore, calling `increment()` with a negative argument looks really weird to me, so I think `decrement()` should be part of the interface too.
Hey all,The proposal is a result of the review of many existing PHP cache systems.To name a few: Stash, DoctrineCache, PHPRedis Extension, Memcached Extension, PPI\Cache.The cache proposal hasn't changed in a few months now and I'm curious to know what's missing, I'd like people to actually contribute to the proposal with any changes they feel are necessary rather than just giving their two cents on the mailing list.
If nobody has any changes to make then I'm going to call up a vote on this within the next few weeks.
The same reasoning applies to CAS operations which I suggested months ago, and which was rejected because some cache types (e.g. files) only support get and set.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/42961bab-fd81-4d7f-a1ca-ccfc58f3ab0f%40googlegroups.com?hl=en.
inteface IncrementableItemInteface { public function increment($value = 1); }
And then, for some cache engine, we can have CacheItem class that implements IncrementableItemInteface, we can check just by instance-of
public function workOnSomeItem(CacheItem $cacheItem) { if ($cacheItem instanceof IncrementableItemInteface) { $cacheItem->increment(123); } }
I maintain a stand-alone Data Mapper that utilizes the increment() functionality in memcache. I'm looking at the standard from the viewpoint of a library that will consume PSR\Cache implementations as drop-in replacements without requiring customization.
This standard doesn't do much good if everyone who uses my Data Mapper library has to customize their chosen Cache library. As such and considering incremeting/decrementing in your cache to invalidate old caches when updates happen is a VERY common practice, I think the PSR needs to deal with the issue in some way.
Now that said, considering that some caching engines support increment functionality, I would suggest that
1) CacheItem::increment() should be a required part of the interface.
2) For those engines that do not provide this support natively, CacheItem should also have an update() or set() method to allow for updating the value of the currently retrieved CacheItem which can be used to manually increment the CacheItem value in the increment() method
>> • eZ Publish - couldn't find the source
eZ Publish switched over to using Stash. In other words, they've already implemented the competing standard. Just check their composer file to see for yourself-
https://github.com/ezsystems/ezpublish-kernel/blob/master/composer.json
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/a48c2de9-4d53-496b-83b8-ae66ccebc82e%40googlegroups.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/7abd31d3-7f42-4592-8c3c-022f356f5e42%40googlegroups.com?hl=en.
Oh sure, be charming, Paul. Like that is playing fair!
Now, here's the difference. First, I think a survey is good if for no other reason than than to begin building support for the PSR and start building involvement. But, it has little use at the end of the project, although it's tough to argue with the notion that FIG should vote something of little value or quality in on the basis that someone worked hard. I agree on that.
In your case, a survey was helpful because you were being inundated with the tabs versus spaces crowd and I hoped it might save you.
I'm a little worried about creating an impression that member projects do not have to pay attention, that mechanisms are in place to make certain solutions will easily work for them. And, frankly, I would expect you to push back on such a notion, too.
So, I took a quick first stab at simply identifying libraries. Maybe if we can confirm this is the scope of cache libraries? Then, if there are so few participating, maybe Paul can focus on their feedback, involvement?
Or, other ideas. Going out for a while, will check back later to see if I can help.
Member projects without cache class:
- Amazon Web Services SDK
- Apache log4php
- Assetic
- Buzz
- Aura Project - no?
- eZ Publish - couldn't find the source
- Jackalope
- Packagist
- PEAR, PEAR2
- phpBB
- phpDocumentor
- PPI, PPI2 - probably waiting for standard ? https://github.com/ppi/cache-module
- Propel, Propel 2
- SabreDAV
- SugarCRM - ???
- Symfony, Symfony2 - don't have one
- TYPO3 - couldn't find it
- Zikula looks like they might be using Doctrine's cache?
These are links to member cache that I was able to quickly find:
- Agavi http://trac.agavi.org/browser/trunk/src/config/AgaviConfigCache.class.php
- CakePHP, CakePHP 2 http://book.cakephp.org/2.0/en/core-libraries/caching.html
- Doctrine, Doctrine2, et al. http://docs.doctrine-project.org/en/2.0.x/reference/caching.html
- Drupal http://api.drupal.org/api/drupal/includes!cache.inc/interface/DrupalCacheInterface/7
- Joomla - https://github.com/joomla/joomla-framework-cache (implemented)
- Laravel - https://github.com/illuminate/cache/blob/master/StoreInterface.php
- Lithium https://github.com/UnionOfRAD/lithium/blob/master/storage/Cache.php
- Packagist n/a
- PyroCMS https://github.com/pyrocms/pyrocms/blob/b0cc973f7abe2285e559105cea6a69a3579ed101/system/codeigniter/libraries/Cache/Cache.php
- Zend Framework 2 https://github.com/zendframework/Component_ZendCache
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/a4653852-4d3a-464d-8614-cafd1a713cb9%40googlegroups.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/27c39b65-43de-4ed5-8261-8315c8e63658%40googlegroups.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/519F8ED3.1080806%40rotorised.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/519F918C.8030903%40rotorised.com?hl=en.
>> • eZ Publish - couldn't find the source
eZ Publish switched over to using Stash. In other words, they've already implemented the competing standard. Just check their composer file to see for yourself-
https://github.com/ezsystems/ezpublish-kernel/blob/master/composer.json
Robert
On May 16, 2013, at 1:18 PM, Paul Jones <pmjo...@gmail.com> wrote:
>
> On May 16, 2013, at 2:03 PM, Amy Stephen wrote:
>
>> I think a survey is good if for no other reason than than to begin building support for the PSR and start building involvement. But, it has little use at the end of the project,
>
> I would argue that the survey is *best* at the beginning of the project, because it will help lead efforts in the direction of "codifying commonalities between member projects." If the survey comes at the end, then it is still useful, because it tells us how much of the proposal is brand new stuff that doesn't exist yet in a member implementation anywhere. (Per Larry Garfield's survey, the leading goal of the group is to codify what exists, and only secondarily to make new things that don't exist yet, which still makes the survey useful.)
>
>
>> I'm a little worried about creating an impression that member projects do not have to pay attention, that mechanisms are in place to make certain solutions will easily work for them.
>
> On the contrary, I think member project representatives will pay *more* attention when they see their project names in discussions that compare and contrast their approaches. Indeed, I think it will drive their participation; everyone wants to make sure their way of doing things is fairly represented.
>
>
>> So, I took a quick first stab at simply identifying libraries. Maybe if we can confirm this is the scope of cache libraries? Then, if there are so few participating, maybe Paul can focus on their feedback, involvement?
>>
>> Or, other ideas. Going out for a while, will check back later to see if I can help.
>>
>> Member projects without cache class:
>
> (FWIW, I googled the project name and "cache" for the following; the best way to determine, though, is to grab the codebase for each project and grep for "cache").
>
>> • Aura Project - no?
>
> Aura does not, but Solar does: <http://solarphp.com/apidoc/package.Solar_Cache>
>
>
>> • eZ Publish - couldn't find the source
>
> Source appears to be at <http://svn.ez.no/svn/ezcomponents/trunk/Cache>
>
>
>> • PEAR, PEAR2
>
> PEAR definitely has a caching package; two, in fact:
>
> - http://pear.php.net/package/Cache
> - http://pear.php.net/package/Cache_Lite
>
>
>> • phpBB
>
> I *think* this is the phpBB cache system, but it might be an add-on: <https://wiki.phpbb.com/Cache>
>
>> • Propel, Propel 2
>
> Propel 1 at least has some sort of caching system: <http://propelorm.org/behaviors/query-cache.html>
>
>
>> • SugarCRM - ???
>
> This document indicates they have one: <http://developers.sugarcrm.com/wordpress/2011/08/30/deciphering-the-sugarcrm-cache-directory/>
>
>
>> • Symfony, Symfony2 - don't have one
>
> Symfony 1 had caching, indicated by this document: <http://symfony.com/legacy/doc/book/1_0/en/12-Caching>
>
>
>> • TYPO3 - couldn't find it
>
> Seems to have one: <http://wiki.typo3.org/Caching_framework>
>
>
>> These are links to member cache that I was able to quickly find:
>> • Agavi http://trac.agavi.org/browser/trunk/src/config/AgaviConfigCache.class.php
>> • CakePHP, CakePHP 2 http://book.cakephp.org/2.0/en/core-libraries/caching.html
>> • Doctrine, Doctrine2, et al. http://docs.doctrine-project.org/en/2.0.x/reference/caching.html
>> • Drupal http://api.drupal.org/api/drupal/includes!cache.inc/interface/DrupalCacheInterface/7
>> • Joomla - https://github.com/joomla/joomla-framework-cache (implemented)
>> • Laravel - https://github.com/illuminate/cache/blob/master/StoreInterface.php
>> • Lithium https://github.com/UnionOfRAD/lithium/blob/master/storage/Cache.php
>> • Packagist n/a
>> • PyroCMS https://github.com/pyrocms/pyrocms/blob/b0cc973f7abe2285e559105cea6a69a3579ed101/system/codeigniter/libraries/Cache/Cache.php
>> • Zend Framework 2 https://github.com/zendframework/Component_ZendCache
>
> /me nods
>
> It appears that a significant number (a majority?) of the voting member projects have a cache implementation of some type. Reviewing those implementations, determining their commonalities, and identifying their weak points (if any) should be the first order for any caching proposal.
>
>
> -- pmj
>
> --
> You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
> To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/41f19463-e6e1-40ee-96d2-fe3bccea2475%40googlegroups.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/995781c7-6e11-4053-b784-d435ab3526a0%40googlegroups.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/A08C38A0-D46C-49E9-9C2D-5AB1BD3EB284%40gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CANqRZ1PFTLDTYFNG9L%2Bsi-wnUE-r6OnT416sas5Lqj7KQTSUoQ%40mail.gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAKxcST_rpdXz03A4Th9bpYLUf3CG%2BMSyzEEuuyHXD7DPxryCag%40mail.gmail.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/4db3e331-7c66-4697-bbb0-dd79391b1e3f%40googlegroups.com?hl=en.
Hi Christoph,Thanks for introducing us to your caching lib and showing us your PSR compliant adapter it looks pretty clean.One thing we are currently thinking about is how to name an interface to handle Increment / Decrement methods.I've thought of CacheIncrementableInterface, what about CacheIncDecInterface? it's shorter and does what it says on the tin.
2013/5/25 Paul Dragoonis <drag...@gmail.com>
Hi Christoph,Thanks for introducing us to your caching lib and showing us your PSR compliant adapter it looks pretty clean.One thing we are currently thinking about is how to name an interface to handle Increment / Decrement methods.I've thought of CacheIncrementableInterface, what about CacheIncDecInterface? it's shorter and does what it says on the tin.I suspect most systems that offer an increment operation will also offer a decrement operation (or at least in that case it should be easy to implement in PHP with get+set). So I see no reason to have "Decrement" as part of the interface name (the same way it's not CacheLockingUnlockingInterface).I also find the "Cache" prefix reundant. The interface is already in a "Psr\Cache" namespace, so "LockingInterface" is enough IMHO. But I'm relatively new to cleanly namespacing my classes, so maybe it's good to have the "Cache" part be in the interface name.Everything else regarding the name is IMHO just wasted time. Pick one, settle on it and then have people complain about it forever. Just the way the world works. ;-)Having multiple interfaces for extra functionality makes sense, IMHO. However, it makes my library somewhat harder, as I cannot have one single "PSR wrapper". Well, I could, but that would hide the specifics of the underlying adapter from the user.But those considerations should not stop the PSR interface from being well structured.
Greetings,ChristophOn Sat, May 25, 2013 at 9:32 PM, Christoph Mewes <christo...@gmail.com> wrote:
Hi everyone,I just wanted to share my experiences from working on our caching library BabelCache[1], which currently gets a major overhaul.For now, I've added an experimental support[2] for the proposed interface and can from my end confirm that most of the proposed operations are well portable (supported by many caching backends). Filesystem proves to be slowest one, but as long as there are PHP-only fallbacks for high-level operations like inc/dec, I would be fine to add more. Currently, I settled with* AdapterInterface: get, set, remove, exists, clear* IncrementInterface: increment (there is no decrement here - yet?)* MultiOpsInterface: getMultiple, setMultiple* LockingInterface: lock, unlockWhereas the AdapterInterface would pretty much map to the proposed CacheInterface (but Cache and Adapter are different terms in BabelCache, so don't get confused ;-)The only thing that worries me is the TTL support in the proposal. By far not every backend supports a TTL and if supporting an expiration would be a requirement for implement the PSR interface, that could very well create some serializing overhead. One would have to encode the expiry into the cache item's value, which could in some storages kill the ability to increment easily (I think of Redis, which does support storing strings, so I have to serialize objects; but to use the INCR command, values need to be unserialized in Redis).I'm very fine with offering it as it's currently: An optional feature the underlying backend does not need to support.Sorry if this got mixed up somewhere in the discussion, I'm still unable to properly handle Google Groups.Greetings,Christoph
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CACvMGnBCMLSubDOoO4rdoTZS_pss-Zr_h%2B9NZPZ5MQDfsu%2BK9g%40mail.gmail.com?hl=en.
On Sat, May 25, 2013 at 10:57 PM, Christoph <chri...@ymail.com> wrote:
2013/5/25 Paul Dragoonis <drag...@gmail.com>
Hi Christoph,Thanks for introducing us to your caching lib and showing us your PSR compliant adapter it looks pretty clean.One thing we are currently thinking about is how to name an interface to handle Increment / Decrement methods.I've thought of CacheIncrementableInterface, what about CacheIncDecInterface? it's shorter and does what it says on the tin.I suspect most systems that offer an increment operation will also offer a decrement operation (or at least in that case it should be easy to implement in PHP with get+set). So I see no reason to have "Decrement" as part of the interface name (the same way it's not CacheLockingUnlockingInterface).I also find the "Cache" prefix reundant. The interface is already in a "Psr\Cache" namespace, so "LockingInterface" is enough IMHO. But I'm relatively new to cleanly namespacing my classes, so maybe it's good to have the "Cache" part be in the interface name.Everything else regarding the name is IMHO just wasted time. Pick one, settle on it and then have people complain about it forever. Just the way the world works. ;-)Having multiple interfaces for extra functionality makes sense, IMHO. However, it makes my library somewhat harder, as I cannot have one single "PSR wrapper". Well, I could, but that would hide the specifics of the underlying adapter from the user.But those considerations should not stop the PSR interface from being well structured.I agree that the interface names don't need the double Cache prefix.
Hey all,The proposal is a result of the review of many existing PHP cache systems.To name a few: Stash, DoctrineCache, PHPRedis Extension, Memcached Extension, PPI\Cache.The cache proposal hasn't changed in a few months now and I'm curious to know what's missing, I'd like people to actually contribute to the proposal with any changes they feel are necessary rather than just giving their two cents on the mailing list.If nobody has any changes to make then I'm going to call up a vote on this within the next few weeks.Thanks all and lets be productive and pragmatic to bring closure to a proposal that's been open for a long time now.Regards,Paul Dragoonis
On Sat, May 25, 2013 at 11:25 PM, Paul Dragoonis <drag...@gmail.com> wrote:On Sat, May 25, 2013 at 10:57 PM, Christoph <chri...@ymail.com> wrote:
2013/5/25 Paul Dragoonis <drag...@gmail.com>
Hi Christoph,Thanks for introducing us to your caching lib and showing us your PSR compliant adapter it looks pretty clean.One thing we are currently thinking about is how to name an interface to handle Increment / Decrement methods.I've thought of CacheIncrementableInterface, what about CacheIncDecInterface? it's shorter and does what it says on the tin.I suspect most systems that offer an increment operation will also offer a decrement operation (or at least in that case it should be easy to implement in PHP with get+set). So I see no reason to have "Decrement" as part of the interface name (the same way it's not CacheLockingUnlockingInterface).I also find the "Cache" prefix reundant. The interface is already in a "Psr\Cache" namespace, so "LockingInterface" is enough IMHO. But I'm relatively new to cleanly namespacing my classes, so maybe it's good to have the "Cache" part be in the interface name.Everything else regarding the name is IMHO just wasted time. Pick one, settle on it and then have people complain about it forever. Just the way the world works. ;-)Having multiple interfaces for extra functionality makes sense, IMHO. However, it makes my library somewhat harder, as I cannot have one single "PSR wrapper". Well, I could, but that would hide the specifics of the underlying adapter from the user.But those considerations should not stop the PSR interface from being well structured.I agree that the interface names don't need the double Cache prefix.One problem with that though,We have Psr\Cache\CacheInterface, if we removed the prefix it would just be Psr\Cache\Interface, which doesn't make sense.
To not talk about the naming forever, this shall be my final comment regarding this topic ;-)Greetings,Christoph
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CACvMGnCX6d4kV_5bw%2Bb4%2BvrKBihMzB4NQsd6FMAX6Ry2mYCFGQ%40mail.gmail.com?hl=en.
Hey,Having inc/dec in standard interface should be pretty easy and since most common engines (apc/memcached/redis/db) support this kind of operation I don't think it would be a problem. We could always return false for failing/not supported operation, no?
Maybe we can have a look for CAS as well in the first interface seeing that apc/memcached/redis/db engines all support it, no?As for locking/unlocking, besides DB and, I think, Redis, there's no other engine that supports this kind of operation. Maybe you could consider CAS operations as being able to emulate but emulation vs native support are two different topics. I'm strongly against having locking support in a PSR for cache as there's a risk in implementation in doing something like using other keys * creating new keys named '$key . "_lock" ' for example to emulate this feature * which in turn it will create a disaster for the end-user.
Same goes for more sensible things like tags or namespaces. Maybe we could review them in a later/next PSR to extend this one but imho when we talk about cache we should always focus on why we need cache in the first place and what we expect from it to be.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/51A3799A.8080303%40rotorised.com?hl=en.
On Mon, May 27, 2013 at 4:19 PM, Ryan McCue <li...@rotorised.com> wrote:
Christoph wrote:Option B can still be (mostly) atomic, it just needs to check before
> It would be important to specify excatly what increment() should do to a
> value.
>
> a) increment should work for every numerical value => no atomic
> increment on memcached anymore
> b) increment should work only for uints => no atomic increment on Redis
> anymore
hand that the value is not negative. All the increments will fail if the
value is negative, and all will succeed if it's positive. The only time
it may be dodgy is if the value is changed between the check and the
increment, however IMO that's an edge case that doesn't matter.Am I correct in assuming this is an implementation-level decision on how users handle the parameters passed to increment()/decrement() methods ?
On the topic of inc/dec, my gut feeling tells me that the following signatures should be enoughpublic function increment($key, $value = null);public function decrement($key, $value = null);The point of the optional values is that you can by default inc/dev by 1, similar to $i++ or $i--. However you can pass an inc/dev value such as int(25). This is how Memcached works. As for Redis they have 'inc' and 'incBy' which is the same functionality encompassed by the option $value parameter.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CACvMGnBES403fc2i9hq%3DZBdgFYrpe-E61mgmQ9nio%3DTUp%3DCB%3Dw%40mail.gmail.com?hl=en.
We now have IncrementableInterface
Looks good to me. :-) Where in the PSR would notes about the specific details on increment/decrement be put?
I'd like to fork and extend the spec by stating what happens to unknown keys and stuff. Or is it easier if you put it in, Paul, so there is just one pull request to PSR and not a tree of them? I can live with either one :-)
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CACvMGnCe8E_dhmM7vVzpv1c7Ryrqj%2BU4P%2BrDy08D0JT7fvdoXw%40mail.gmail.com?hl=en.
I'd like to fork and extend the spec by stating what happens to unknown keys and stuff. Or is it easier if you put it in, Paul, so there is just one pull request to PSR and not a tree of them? I can live with either one :-)You normally fork my proposal and PR against it, but there's some kind of github forking limit issue so you can't fork it last time we checked so instead you gotta write out the text on a http://gist.github.com link for example and I paste it in.
I'd like to fork and extend the spec by stating what happens to unknown keys and stuff. Or is it easier if you put it in, Paul, so there is just one pull request to PSR and not a tree of them? I can live with either one :-)You normally fork my proposal and PR against it, but there's some kind of github forking limit issue so you can't fork it last time we checked so instead you gotta write out the text on a http://gist.github.com link for example and I paste it in.I worked out a workaround to this problem specifically because fig-standards suffers from this GitHub limitation. Feel free to use a gist but there is no reason to avoid a PR if you are comfortable with a little URL hacking.
Anything remaining yet to bring this to a vote?
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/0e1f36c7-f884-409b-a92c-7e9043de5fff%40googlegroups.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAFp73XuOBo2edZnGi044j9BPqgmFQhpzV%3D2XOr00J1n_iyENAg%40mail.gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAEJbJpi%2B2yDqHaW3dkGorUwEP%2BWDppdgOkBDpB0jdrkUKSjpSg%40mail.gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAA9esyTm2vGSta%3D-7j5hy3Vi-1nCQGBDLswp%2BwPLXGBCMRA0fQ%40mail.gmail.com?hl=en.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAA9esyTm2vGSta%3D-7j5hy3Vi-1nCQGBDLswp%2BwPLXGBCMRA0fQ%40mail.gmail.com?hl=en.