XOOPS RMCommon Utilities
2.1.8.91RC
|
Public Member Functions | |
__construct () | |
addConstructorLookup ($lookup) | |
addConstructorValue ($value) | |
asAliasOf ($lookup) | |
asNewInstanceOf ($className) | |
asSharedInstanceOf ($className) | |
asValue ($value) | |
createDependenciesFor ($itemName) | |
has ($itemName) | |
listItems () | |
lookup ($itemName) | |
register ($itemName) | |
withDependencies (array $lookups) | |
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
const | TYPE_ALIAS = 0x1000 |
const | TYPE_INSTANCE = 0x0010 |
const | TYPE_SHARED = 0x0100 |
const | TYPE_VALUE = 0x0001 |
Private Member Functions | |
_createAlias ($itemName) | |
_createNewInstance ($itemName) | |
_createSharedInstance ($itemName) | |
& | _getEndPoint () |
_getValue ($itemName) | |
_lookupRecursive ($item) | |
_resolveArgs (array $args) | |
Private Attributes | |
$_endPoint | |
$_store = array() | |
Static Private Attributes | |
static | $_instance = null |
Definition at line 18 of file DependencyContainer.php.
Swift_DependencyContainer::__construct | ( | ) |
Constructor should not be used. Use getInstance() instead.
Definition at line 46 of file DependencyContainer.php.
|
private |
Resolve an alias to another item
Definition at line 269 of file DependencyContainer.php.
References lookup().
Referenced by lookup().
|
private |
Create a fresh instance of $itemName
Definition at line 275 of file DependencyContainer.php.
References createDependenciesFor().
Referenced by _createSharedInstance(), and lookup().
|
private |
Create and register a shared instance of $itemName
Definition at line 291 of file DependencyContainer.php.
References _createNewInstance().
Referenced by lookup().
|
private |
Get the current endpoint in the store
Definition at line 301 of file DependencyContainer.php.
References $_endPoint.
Referenced by addConstructorLookup(), addConstructorValue(), asAliasOf(), asNewInstanceOf(), asSharedInstanceOf(), asValue(), and withDependencies().
|
private |
Get the literal value with $itemName
Definition at line 263 of file DependencyContainer.php.
Referenced by lookup().
|
private |
Resolve a single dependency with an collections
Definition at line 332 of file DependencyContainer.php.
References lookup().
Referenced by _resolveArgs().
|
private |
Get an argument list with dependencies resolved
Definition at line 313 of file DependencyContainer.php.
References _lookupRecursive().
Referenced by createDependenciesFor().
Swift_DependencyContainer::addConstructorLookup | ( | $lookup | ) |
Specify a dependency lookup for the constructor of the previously registered item.
string | $lookup |
Definition at line 249 of file DependencyContainer.php.
References _getEndPoint().
Referenced by withDependencies().
Swift_DependencyContainer::addConstructorValue | ( | $value | ) |
Specify a literal (non looked up) value for the constructor of the previously registered item.
mixed | $value |
Definition at line 230 of file DependencyContainer.php.
References _getEndPoint().
Swift_DependencyContainer::asAliasOf | ( | $lookup | ) |
Specify the previously registered item as an alias of another item.
string | $lookup |
Definition at line 163 of file DependencyContainer.php.
References _getEndPoint().
Swift_DependencyContainer::asNewInstanceOf | ( | $className | ) |
Specify the previously registered item as a new instance of $className. register() must be called before this will work. Any arguments can be set with withDependencies(), addConstructorValue() or addConstructorLookup().
string | $className |
Definition at line 181 of file DependencyContainer.php.
References _getEndPoint().
Swift_DependencyContainer::asSharedInstanceOf | ( | $className | ) |
Specify the previously registered item as a shared instance of $className. register() must be called before this will work.
string | $className |
Definition at line 195 of file DependencyContainer.php.
References _getEndPoint().
Swift_DependencyContainer::asValue | ( | $value | ) |
Specify the previously registered item as a literal value. register() must be called before this will work.
mixed | $value |
Definition at line 150 of file DependencyContainer.php.
References _getEndPoint().
Swift_DependencyContainer::createDependenciesFor | ( | $itemName | ) |
Create an array of arguments passed to the constructor of $itemName.
string | $itemName |
Definition at line 116 of file DependencyContainer.php.
References _resolveArgs().
Referenced by _createNewInstance().
|
static |
Returns a singleton of the DependencyContainer.
Definition at line 52 of file DependencyContainer.php.
Referenced by Swift_FailoverTransport\__construct(), Swift_LoadBalancedTransport\__construct(), Swift_MailTransport\__construct(), Swift_SendmailTransport\__construct(), Swift_SmtpTransport\__construct(), Swift_MimePart\__construct(), Swift_EmbeddedFile\__construct(), Swift_Attachment\__construct(), Swift_Message\__construct(), Swift_Encoding\_lookup(), Swift_Preferences\setCacheType(), Swift_Preferences\setCharset(), and Swift_Preferences\setTempDir().
Swift_DependencyContainer::has | ( | $itemName | ) |
Test if an item is registered in this container with the given name.
string | $itemName |
Definition at line 76 of file DependencyContainer.php.
Referenced by lookup().
Swift_DependencyContainer::listItems | ( | ) |
List the names of all items stored in the Container.
Definition at line 65 of file DependencyContainer.php.
Swift_DependencyContainer::lookup | ( | $itemName | ) |
Lookup the item with the given $itemName.
string | $itemName |
Swift_DependencyException | If the dependency is not found |
Definition at line 89 of file DependencyContainer.php.
References _createAlias(), _createNewInstance(), _createSharedInstance(), _getValue(), and has().
Referenced by _createAlias(), and _lookupRecursive().
Swift_DependencyContainer::register | ( | $itemName | ) |
Register a new dependency with $itemName. This method returns the current DependencyContainer instance because it requires the use of the fluid interface to set the specific details for the dependency.
string | $itemName |
Definition at line 136 of file DependencyContainer.php.
Swift_DependencyContainer::withDependencies | ( | array | $lookups | ) |
Specify a list of injected dependencies for the previously registered item. This method takes an array of lookup names.
array | $lookups |
Definition at line 211 of file DependencyContainer.php.
References _getEndPoint(), and addConstructorLookup().
|
private |
The current endpoint in the data container
Definition at line 40 of file DependencyContainer.php.
Referenced by _getEndPoint().
|
staticprivate |
Singleton instance
Definition at line 34 of file DependencyContainer.php.
|
private |
The data container
Definition at line 37 of file DependencyContainer.php.
const Swift_DependencyContainer::TYPE_ALIAS = 0x1000 |
Constant for aliases
Definition at line 31 of file DependencyContainer.php.
const Swift_DependencyContainer::TYPE_INSTANCE = 0x0010 |
Constant for new instance types
Definition at line 25 of file DependencyContainer.php.
const Swift_DependencyContainer::TYPE_SHARED = 0x0100 |
Constant for shared instance types
Definition at line 28 of file DependencyContainer.php.
const Swift_DependencyContainer::TYPE_VALUE = 0x0001 |
Constant for literal value types
Definition at line 22 of file DependencyContainer.php.