From 149d22c7bcf766c211ff05243f6b227ddbdd4398 Mon Sep 17 00:00:00 2001 From: RichardLynch Date: Mon, 20 May 2013 15:55:56 -0500 Subject: [PATCH] Update PSR-Cache.md Suppose you have a Drupal plugin that uses PSR-Cache and is configured to use, say, APC. Then you add, say, a Symfony app that also uses APC. There are bound to be key collisions here. I would propose a "prefix" property and a composeKey ($key) { return $this->prefix . $key; } This would allow each app to have their own configurable prefix providing a namespace. It still doesn't guarantee two children won't use the same prefix . $key, but at least it gives the developers a sensible way out of the dilemma. Frameworks could have standards to reduce the probability of collision. Ex, Drupal could standardize on 'Drupal_Modulename_site' as the default. The 'site' part covers multisite. --- proposed/PSR-Cache.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proposed/PSR-Cache.md b/proposed/PSR-Cache.md index 64791ca2a..1879ca1ef 100644 --- a/proposed/PSR-Cache.md +++ b/proposed/PSR-Cache.md @@ -118,6 +118,9 @@ namespace PSR\Cache; */ interface Pool { + + protected $prefix; + /** * Returns objects which implement the Cache\Item interface. * @@ -244,4 +247,4 @@ interface Item */ function remove(); } -``` \ No newline at end of file +```