Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • Swift
  • Swift_ConfigurableSpool
  • Swift_DependencyContainer
  • Swift_FileSpool
  • Swift_Mailer
  • Swift_MemorySpool
  • Swift_NullTransport
  • Swift_Preferences
  • Swift_SpoolTransport
  • Swift_StreamFilters_ByteArrayReplacementFilter
  • Swift_StreamFilters_StringReplacementFilter
  • Swift_StreamFilters_StringReplacementFilterFactory
  • Swift_Transport_NullTransport
  • Swift_Transport_SpoolTransport
  • Swift_Validate
  • waMail

Interfaces

  • Swift_Filterable
  • Swift_ReplacementFilterFactory
  • Swift_Spool
  • Swift_StreamFilter

Exceptions

  • Swift_DependencyException
  • Swift_IoException
  • Swift_RfcComplianceException
  • Swift_SwiftException
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Swift_DependencyContainer

Dependency Injection container.

Package: Swift
Author: Chris Corbyn
Located at wa-system/vendors/swift/classes/Swift/DependencyContainer.php
Methods summary
public
# __construct( )

Constructor should not be used.

Constructor should not be used.

Use Swift_DependencyContainer::getInstance() instead.

public static Swift_DependencyContainer
# getInstance( )

Returns a singleton of the DependencyContainer.

Returns a singleton of the DependencyContainer.

Returns

Swift_DependencyContainer
public array
# listItems( )

List the names of all items stored in the Container.

List the names of all items stored in the Container.

Returns

array
public boolean
# has( string $itemName )

Test if an item is registered in this container with the given name.

Test if an item is registered in this container with the given name.

Parameters

$itemName
string
$itemName

Returns

boolean

See

Swift_DependencyContainer::register()
public mixed
# lookup( string $itemName )

Lookup the item with the given $itemName.

Lookup the item with the given $itemName.

Parameters

$itemName
string
$itemName

Returns

mixed

Throws

Swift_DependencyException
If the dependency is not found

See

Swift_DependencyContainer::register()
public array
# createDependenciesFor( string $itemName )

Create an array of arguments passed to the constructor of $itemName.

Create an array of arguments passed to the constructor of $itemName.

Parameters

$itemName
string
$itemName

Returns

array
public Swift_DependencyContainer
# register( string $itemName )

Register a new dependency with $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.

Parameters

$itemName
string
$itemName

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::asNewInstanceOf(), Swift_DependencyContainer::asSharedInstanceOf(), Swift_DependencyContainer::asValue()
public Swift_DependencyContainer
# asValue( mixed $value )

Specify the previously registered item as a literal value.

Specify the previously registered item as a literal value.

Swift_DependencyContainer::register() must be called before this will work.

Parameters

$value
mixed
$value

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# asAliasOf( string $lookup )

Specify the previously registered item as an alias of another item.

Specify the previously registered item as an alias of another item.

Parameters

$lookup
string
$lookup

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# asNewInstanceOf( string $className )

Specify the previously registered item as a new instance of $className.

Specify the previously registered item as a new instance of $className.

Swift_DependencyContainer::register() must be called before this will work. Any arguments can be set with Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue() or Swift_DependencyContainer::addConstructorLookup().

Parameters

$className
string
$className

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# asSharedInstanceOf( string $className )

Specify the previously registered item as a shared instance of $className.

Specify the previously registered item as a shared instance of $className.

Swift_DependencyContainer::register() must be called before this will work.

Parameters

$className
string
$className

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# withDependencies( array $lookups )

Specify a list of injected dependencies for the previously registered item.

Specify a list of injected dependencies for the previously registered item.

This method takes an array of lookup names.

Parameters

$lookups
array
$lookups

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# addConstructorValue( mixed $value )

Specify a literal (non looked up) value for the constructor of the previously registered item.

Specify a literal (non looked up) value for the constructor of the previously registered item.

Parameters

$value
mixed
$value

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# addConstructorLookup( string $lookup )

Specify a dependency lookup for the constructor of the previously registered item.

Specify a dependency lookup for the constructor of the previously registered item.

Parameters

$lookup
string
$lookup

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue()
private
# _getValue( mixed $itemName )

Get the literal value with $itemName

Get the literal value with $itemName

private
# _createAlias( mixed $itemName )

Resolve an alias to another item

Resolve an alias to another item

private
# _createNewInstance( mixed $itemName )

Create a fresh instance of $itemName

Create a fresh instance of $itemName

private
# _createSharedInstance( mixed $itemName )

Create and register a shared instance of $itemName

Create and register a shared instance of $itemName

private &
# _getEndPoint( )

Get the current endpoint in the store

Get the current endpoint in the store

private
# _resolveArgs( array $args )

Get an argument list with dependencies resolved

Get an argument list with dependencies resolved

private
# _lookupRecursive( mixed $item )

Resolve a single dependency with an collections

Resolve a single dependency with an collections

Constants summary
integer TYPE_VALUE 0x0001
#

Constant for literal value types

Constant for literal value types

integer TYPE_INSTANCE 0x0010
#

Constant for new instance types

Constant for new instance types

integer TYPE_SHARED 0x0100
#

Constant for shared instance types

Constant for shared instance types

integer TYPE_ALIAS 0x1000
#

Constant for aliases

Constant for aliases

Properties summary
private static mixed $_instance null
#

Singleton instance

Singleton instance

private array $_store array()
#

The data container

The data container

private mixed $_endPoint
#

The current endpoint in the data container

The current endpoint in the data container

My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0