Changeset 1006
- Timestamp:
- 11/08/07 20:20:01 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ioc/stubBinder.php
r852 r1006 31 31 */ 32 32 class stubBinder extends stubBaseObject { 33 34 /** 35 * Key for storing the binder in the registry 36 */ 37 const REGISTRY_KEY = 'net.stubbles.ioc.stubBinder'; 33 38 34 39 /** trunk/src/main/php/net/stubbles/ioc/stubIOCPreInterceptor.php
r867 r1006 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 * @author Stephan Schmidt <schst@stubbles.net> 6 7 * @package stubbles 7 8 * @subpackage ioc 8 9 */ 9 10 stubClassLoader::load('net.stubbles.ipo.interceptors.stubPreInterceptor', 10 'net.stubbles.ioc. ioc',11 'net.stubbles.ioc.stubBinder', 11 12 'net.stubbles.util.stubRegistry' 12 13 ); … … 28 29 public function preProcess(stubRequest $request, stubSession $session, stubResponse $response) 29 30 { 30 $binder = new stubBinder(); 31 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 32 if ($binder === null) { 33 $binder = new stubBinder(); 34 stubRegistry::set(stubBinder::REGISTRY_KEY, $binder); 35 } 31 36 $binder->bind('stubRequest')->toInstance($request); 32 37 $binder->bind('stubSession')->toInstance($session); 33 38 $binder->bind('stubResponse')->toInstance($response); 34 stubRegistry::set('net.stubbles.ioc.stubBinder', $binder);35 39 } 36 40 }
