Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Better capabilities surrounding sharing
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
weierophinney committed Jun 22, 2012
1 parent 0c801d1 commit 688f142
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
9 changes: 1 addition & 8 deletions src/PatternPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions src/Storage/AdapterPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions src/Storage/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 688f142

Please sign in to comment.