Changeset 1197
- Timestamp:
- 12/29/07 14:22:43 (10 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/ioc/annotations/stubImplementedByAnnotation.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResource.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResourceManager.php (modified) (16 diffs)
- trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResourceManagerPreInterceptor.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/websites/stubPageConfigurationException.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ioc/annotations/stubImplementedByAnnotation.php
r844 r1197 1 1 <?php 2 2 /** 3 * Annotation to mark the default implementation 4 * of an interface 3 * Annotation to mark the default implementation of an interface. 5 4 * 6 5 * @author Stephan Schmidt <schst@stubbles.net> 7 6 * @package stubbles 8 * @subpackage ioc_ injection7 * @subpackage ioc_annotations 9 8 */ 10 11 9 stubClassLoader::load('net.stubbles.reflection.annotations.stubAbstractAnnotation', 12 'net.stubbles.reflection.stubReflectionClass' );13 10 'net.stubbles.reflection.stubReflectionClass' 11 ); 14 12 /** 15 * Annotation to mark the default implementation 16 * of an interface 13 * Annotation to mark the default implementation of an interface. 17 14 * 18 15 * @package stubbles 19 * @subpackage ioc_ injection16 * @subpackage ioc_annotations 20 17 */ 21 18 class stubImplementedByAnnotation extends stubAbstractAnnotation trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResource.php
r1127 r1197 3 3 * Base interface for all session resources. 4 4 * 5 * All interfaces must be serializable as they will6 * be stored in the session.7 *8 5 * @author Stephan Schmidt <schst@stubbles.net> 9 6 * @package stubbles 10 * @subpackage ipo_resourcemanager 7 * @subpackage ipo_session_resourcemanager 8 */ 9 /** 10 * Base interface for all session resources. 11 * 12 * All interfaces must be serializable as they will be stored in the session. 13 * 14 * @package stubbles 15 * @subpackage ipo_session_resourcemanager 11 16 */ 12 17 interface stubSessionResource extends stubSerializable trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResourceManager.php
r1177 r1197 3 3 * Class to manage session resources. 4 4 * 5 * This class is inspired by the ContextResourceManager6 * of the Pustefix framework7 *8 5 * @author Stephan Schmidt <schst@stubbles.net> 9 6 * @package stubbles 10 * @subpackage ipo_resourcemanager 11 * @link http://pustefix.oss.schlund.de 7 * @subpackage ipo_session_resourcemanager 12 8 */ 13 9 stubClassLoader::load('net.stubbles.ipo.session.resourcemanager.stubSessionResource', … … 19 15 * Class to manage session resources. 20 16 * 21 * This class is inspired by the ContextResourceManager 22 * of the Pustefix framework17 * This class is inspired by the ContextResourceManager of the Pustefix 18 * framework. 23 19 * 24 * @author Stephan Schmidt <schst@stubbles.net>25 20 * @package stubbles 26 * @subpackage ipo_resourcemanager 21 * @subpackage ipo_session_resourcemanager 22 * @link http://pustefix.oss.schlund.de 27 23 */ 28 24 class stubSessionResourceManager extends stubSerializableObject implements stubInjectionProvider 29 25 { 30 26 /** 31 * All available interfaces and the matching 32 * implementations 27 * all available interfaces and the matching implementations 33 28 * 34 29 * @var array<string,string> … … 36 31 protected $resourceDefinitions = array(); 37 32 /** 38 * All resources33 * all resources 39 34 * 40 35 * @var array<string,object> 41 36 */ 42 protected $resources = array();43 /** 44 * Session of the request37 protected $resources = array(); 38 /** 39 * session of the request 45 40 * 46 41 * @var stubSession … … 48 43 protected $session; 49 44 45 /** 46 * constructor 47 * 48 * @param stubSession $session 49 */ 50 50 public function __construct(stubSession $session) 51 51 { … … 54 54 55 55 /** 56 * Add a new resource definition.56 * adds a new resource definition 57 57 * 58 58 * @param string $class … … 67 67 68 68 /** 69 * Get a resource for a specifiec type. 70 * 71 * This is required by the stubInjectionProvider interface. 69 * returns a resource for a specifiec type 72 70 * 73 71 * As PHP has no namespace, this only works, as long as there … … 75 73 * 76 74 * @param stubBaseReflectionClass $type 75 * @see net::stubbles::ioc::stubInjectionProvider::get() 77 76 */ 78 77 public function get(stubBaseReflectionClass $type) … … 89 88 90 89 /** 91 * Get a resource.90 * returns a resource 92 91 * 93 92 * If a resource is not available in the session, … … 101 100 $interface = $this->getFullQualifiedInterfaceName($interface); 102 101 $implementation = $this->getImplementation($interface); 103 104 102 if (isset($this->resources[$implementation]) === true) { 105 103 return $this->resources[$implementation]; … … 115 113 $interfaceClazz = new stubReflectionClass($interface); 116 114 $shortInterfaceName = $interfaceClazz->getName(); 117 if ( !$this->resources[$implementation] instanceof $shortInterfaceName) {115 if (($this->resources[$implementation] instanceof $shortInterfaceName) === false) { 118 116 throw new stubConfigurationException("{$implementation} does not implement interface {$interface}."); 119 117 } … … 124 122 125 123 /** 126 * Get the full qualified name of an interface.124 * returns the full qualified name of an interface 127 125 * 128 126 * This method converts an instance of stubReflectionClass … … 147 145 return $interface; 148 146 } 147 149 148 if ($interface instanceof stubReflectionClass) { 150 149 if ($interface->isInterface() === false) { … … 163 162 164 163 /** 165 * Check, whether a resource is registered with the 166 * resource manager. 164 * checks whether a resource is registered in the resource manager 167 165 * 168 166 * @param string|stubReflectionClass $interface … … 176 174 177 175 /** 178 * Get the concrete implementation for an interface.176 * returns the concrete implementation for an interface 179 177 * 180 178 * @param string $interface … … 192 190 193 191 /** 194 * Createa session resource192 * creates a session resource 195 193 * 196 194 * @param string $implementation … … 204 202 205 203 /** 206 * Register all session resources with the binder.204 * registers all session resources with the binder 207 205 * 208 206 * @param stubBinder $binder trunk/src/main/php/net/stubbles/ipo/session/resourcemanager/stubSessionResourceManagerPreInterceptor.php
r909 r1197 2 2 /** 3 3 * Interceptor to initialize the stubResourceManager. 4 * 5 * @author Stephan Schmidt <schst@stubbles.net> 6 * @author Frank Kleine <mikey@stubbles.net> 7 * @package stubbles 8 * @subpackage ipo_session_resourcemanager 9 */ 10 stubClassLoader::load('net.stubbles.ipo.interceptors.stubPreInterceptor', 11 'net.stubbles.ipo.session.resourcemanager.stubSessionResourceManager', 12 'net.stubbles.util.stubXJConfAbstractInitializer' 13 ); 14 /** 15 * Interceptor to initialize the stubRessourceManager. 4 16 * 5 17 * If the registry contains a net.stubbles.ioc.stubBinder, the … … 7 19 * all resources. 8 20 * 9 * @author Stephan Schmidt <schst@stubbles.net>10 * @author Frank Kleine <mikey@stubbles.net>11 21 * @package stubbles 12 * @subpackage ipo_resourcemanager 13 */ 14 stubClassLoader::load('net.stubbles.ipo.interceptors.stubPreInterceptor', 15 'net.stubbles.ipo.session.resourcemanager.stubSessionResourceManager', 16 'net.stubbles.util.stubXJConfAbstractInitializer'); 17 /** 18 * Interceptor to initialize the stubRessourceManager 19 * 20 * @package stubbles 21 * @subpackage ipo_resourcemanager 22 * @subpackage ipo_session_resourcemanager 22 23 */ 23 24 class stubSessionResourceManagerPreInterceptor extends stubXJConfAbstractInitializer implements stubXJConfInitializer, stubPreInterceptor 24 25 { 25 26 /** 26 * All configured resources as read from session-resources.xml27 * all configured resources as read from session-resources.xml 27 28 * 28 29 * @var array<string,array<string>> … … 62 63 public function loadData(stubXJConfFacade $xjconf) 63 64 { 64 $this->resourceConfig = $xjconf->getConfigValue('resources');65 $this->resourceConfig = $xjconf->getConfigValue('resources'); 65 66 } 66 67 trunk/src/main/php/net/stubbles/websites/stubPageConfigurationException.php
r777 r1197 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage websites _pages7 * @subpackage websites 8 8 */ 9 9 stubClassLoader::load('net.stubbles.lang.exceptions.stubChainedException'); … … 12 12 * 13 13 * @package stubbles 14 * @subpackage websites _pages14 * @subpackage websites 15 15 */ 16 16 class stubPageConfigurationException extends stubChainedException
