Changeset 1751
- Timestamp:
- 07/30/08 15:43:04 (4 months ago)
- Files:
-
- framework/trunk/src/main/php/net/stubbles/ioc/stubAbstractIOCPreInterceptor.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/ioc/stubBindingScopeSession.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/ioc/stubIOCPreInterceptor.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcAbstractInvokingSubProcessor.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisLoadExtensionPageElement.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/websites/xml/skin/stubDefaultSkinGenerator.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php (modified) (2 diffs)
- framework/trunk/src/main/php/net/stubbles/xml/rss/stubRSSProcessor.php (modified) (2 diffs)
- framework/trunk/src/test/php/net/stubbles/ioc/IOCTestSuite.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/ioc/stubAbstractIOCPreInterceptor.php
r1534 r1751 9 9 stubClassLoader::load('net::stubbles::ipo::interceptors::stubPreInterceptor', 10 10 'net::stubbles::ioc::stubBinder', 11 'net::stubbles:: lang::stubRegistry'11 'net::stubbles::ioc::stubBinderRegistry' 12 12 ); 13 13 /** … … 28 28 public function preProcess(stubRequest $request, stubSession $session, stubResponse $response) 29 29 { 30 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 31 if (null === $binder) { 32 $binder = new stubBinder(); 33 stubRegistry::set(stubBinder::REGISTRY_KEY, $binder); 34 } 35 36 $this->configure($binder); 30 $this->configure(stubBinderRegistry::create()); 37 31 } 38 32 framework/trunk/src/main/php/net/stubbles/ioc/stubBindingScopeSession.php
r1534 r1751 8 8 */ 9 9 stubClassLoader::load('net::stubbles::ioc::stubBinder', 10 'net::stubbles::ioc::stubBinderRegistry', 10 11 'net::stubbles::ioc::stubBindingScope', 11 12 'net::stubbles::ioc::stubValueInjectionProvider', 12 'net::stubbles::lang::stubRegistry',13 13 'net::stubbles::lang::exceptions::stubRuntimeException' 14 14 ); … … 88 88 /** 89 89 * retrieves the session from the binder 90 *91 * @throws stubRuntimeException92 90 */ 93 91 protected function getSession() 94 92 { 95 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 96 if (null === $binder) { 97 throw new stubRuntimeException('Can not return provider, no access to session possible because of missing binder instance in registry.'); 98 } 99 100 $this->session = $binder->getInjector()->getInstance('stubSession'); 93 $this->session = stubBinderRegistry::get()->getInjector()->getInstance('stubSession'); 101 94 } 102 95 } framework/trunk/src/main/php/net/stubbles/ioc/stubIOCPreInterceptor.php
r1534 r1751 9 9 */ 10 10 stubClassLoader::load('net::stubbles::ipo::interceptors::stubPreInterceptor', 11 'net::stubbles::ioc::stubBinder', 12 'net::stubbles::lang::stubRegistry' 11 'net::stubbles::ioc::stubBinderRegistry' 13 12 ); 14 13 /** … … 29 28 public function preProcess(stubRequest $request, stubSession $session, stubResponse $response) 30 29 { 31 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 32 if (null === $binder) { 33 $binder = new stubBinder(); 34 stubRegistry::set(stubBinder::REGISTRY_KEY, $binder); 35 } 36 30 $binder = stubBinderRegistry::create(); 37 31 $binder->bind('stubRequest')->toInstance($request); 38 32 $binder->bind('stubSession')->toInstance($session); framework/trunk/src/main/php/net/stubbles/service/jsonrpc/subprocessors/stubJsonRpcAbstractInvokingSubProcessor.php
r1547 r1751 9 9 * @subpackage service_jsonrpc_subprocessors 10 10 */ 11 stubClassLoader::load('net::stubbles::ioc::stubBinder ',11 stubClassLoader::load('net::stubbles::ioc::stubBinderRegistry', 12 12 'net::stubbles::ipo::request::validator::stubPassThruValidator', 13 'net::stubbles::lang::stubRegistry',14 13 'net::stubbles::reflection::reflection', 15 14 'net::stubbles::service::annotations::stubWebMethodAnnotation', … … 81 80 } 82 81 83 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 84 if (($binder instanceof stubBinder) === false) { 85 throw new stubRuntimeException('No instance of net::stubbles::ioc::stubBinder in registry.'); 86 } 87 88 $instance = $binder->getInjector()->getInstance($class->getName()); 82 $instance = stubBinderRegistry::get()->getInjector()->getInstance($class->getName()); 89 83 return $method->invokeArgs($instance, $params); 90 84 } framework/trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisLoadExtensionPageElement.php
r1508 r1751 8 8 */ 9 9 stubClassLoader::load('net::stubbles::lang::exceptions::stubIOException', 10 'net::stubbles::ioc::stubBinder ',10 'net::stubbles::ioc::stubBinderRegistry', 11 11 'net::stubbles::websites::memphis::stubMemphisExtension', 12 12 'net::stubbles::websites::memphis::stubMemphisPageElement' … … 66 66 parent::init($request, $session, $response, $context); 67 67 if (null === $this->extension) { 68 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 69 if (($binder instanceof stubBinder) === false) { 70 throw new stubRuntimeException('No instance of net::stubbles::ioc::stubBinder in registry.'); 71 } 72 68 $binder = stubBinderRegistry::get(); 73 69 $binder->bindConstant()->named('context')->to($this->context); 74 70 $binder->bind('stubRequest')->named('prefixed')->toInstance($this->request); framework/trunk/src/main/php/net/stubbles/websites/xml/skin/stubDefaultSkinGenerator.php
r1737 r1751 7 7 * @subpackage websites_xml_skin 8 8 */ 9 stubClassLoader::load('net::stubbles::ioc::stubBinder ',9 stubClassLoader::load('net::stubbles::ioc::stubBinderRegistry', 10 10 'net::stubbles::lang::stubFactory', 11 11 'net::stubbles::lang::stubRegistry', … … 112 112 public function generate(stubSession $session, stubPage $page, $skinName) 113 113 { 114 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 115 if (($binder instanceof stubBinder) === false) { 116 throw new stubRuntimeException('No instance of net::stubbles::ioc::stubBinder in registry.'); 117 } 118 114 $binder = stubBinderRegistry::get(); 119 115 $binder->bind('stubXMLStreamWriter')->to(stubXMLStreamWriterFactory::getFqClassNameAsAvailable()); 120 116 $binder->bindConstant()->named('imagePath')->to(getcwd()); framework/trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php
r1737 r1751 8 8 * @subpackage websites_xml 9 9 */ 10 stubClassLoader::load('net::stubbles::ioc::stubBinder ',10 stubClassLoader::load('net::stubbles::ioc::stubBinderRegistry', 11 11 'net::stubbles::lang::stubRegistry', 12 12 'net::stubbles::lang::exceptions::stubRuntimeException', … … 83 83 } 84 84 85 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 86 if (($binder instanceof stubBinder) === false) { 87 throw new stubRuntimeException('XML/XSL view engine requires IoC.'); 88 } 89 85 $binder = stubBinderRegistry::get(); 90 86 $binder->bind('stubPage')->toInstance($this->page); 91 87 $injector = $binder->getInjector(); framework/trunk/src/main/php/net/stubbles/xml/rss/stubRSSProcessor.php
r1649 r1751 7 7 * @subpackage xml_rss 8 8 */ 9 stubClassLoader::load('net::stubbles::ioc::stubBinder ',9 stubClassLoader::load('net::stubbles::ioc::stubBinderRegistry', 10 10 'net::stubbles::ipo::request::validator::stubPreSelectValidator', 11 'net::stubbles::lang::stubRegistry',12 11 'net::stubbles::lang::exceptions::stubFileNotFoundException', 13 12 'net::stubbles::lang::exceptions::stubRuntimeException', … … 69 68 } 70 69 71 $binder = stubRegistry::get(stubBinder::REGISTRY_KEY); 72 if (($binder instanceof stubBinder) === false) { 73 throw new stubRuntimeException('No binder configured in registry.'); 74 } 75 70 $binder = stubBinderRegistry::get(); 76 71 $this->response->addHeader('Content-Type', 'text/xml'); 77 72 $this->response->write($binder->getInjector() framework/trunk/src/test/php/net/stubbles/ioc/IOCTestSuite.php
r1390 r1751 30 30 $suite->addTestFile($dir . '/annotations/stubSingletonAnnotationTestCase.php'); 31 31 $suite->addTestFile($dir . '/stubAbstractIOCPreInterceptorTestCase.php'); 32 $suite->addTestFile($dir . '/stubBinderRegistryTestCase.php'); 32 33 $suite->addTestFile($dir . '/stubBinderTestCase.php'); 33 34 $suite->addTestFile($dir . '/stubInjectorBasicTestCase.php');
