From 688f1426d13722834a8cb65fcb5ff4205c065b7f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 21 Jun 2012 23:44:20 -0500 Subject: [PATCH] Better capabilities surrounding sharing - Added flag "sharedByDefault" to ServiceManager implementation, set to true by default - Disabling the flag disables storing created instances for re-use - Used with a variety of components: Cache, Crypt, Paginator, and the static variants of Filter and Validator - Cannot re-set the flag if allowOverride is false --- src/PatternPluginManager.php | 9 +-------- src/Storage/AdapterPluginManager.php | 15 +-------------- src/Storage/PluginManager.php | 8 +------- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/PatternPluginManager.php b/src/PatternPluginManager.php index d25c87f6d..fd60d9f00 100644 --- a/src/PatternPluginManager.php +++ b/src/PatternPluginManager.php @@ -55,14 +55,7 @@ class PatternPluginManager extends AbstractPluginManager * * @var array */ - protected $shared = array( - 'callback' => false, - 'capture' => false, - 'class' => false, - 'object' => false, - 'output' => false, - 'page' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin diff --git a/src/Storage/AdapterPluginManager.php b/src/Storage/AdapterPluginManager.php index 99c613d94..3b4da9419 100644 --- a/src/Storage/AdapterPluginManager.php +++ b/src/Storage/AdapterPluginManager.php @@ -64,20 +64,7 @@ class AdapterPluginManager extends AbstractPluginManager * * @var array */ - protected $shared = array( - 'apc' => false, - 'filesystem' => false, - 'memcached' => false, - 'memory' => false, - 'sysvshm' => false, - 'systemvshm' => false, - 'sqlite' => false, - 'dba' => false, - 'wincache' => false, - 'xcache' => false, - 'zendserverdisk' => false, - 'zendservershm' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin diff --git a/src/Storage/PluginManager.php b/src/Storage/PluginManager.php index b84798a02..6caa8ca7a 100644 --- a/src/Storage/PluginManager.php +++ b/src/Storage/PluginManager.php @@ -57,13 +57,7 @@ class PluginManager extends AbstractPluginManager * * @var array */ - protected $shared = array( - 'clearexpiredbyfactor' => false, - 'exceptionhandler' => false, - 'ignoreuserabort' => false, - 'optimizebyfactor' => false, - 'serializer' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin