PHP Class AppserverIo\Appserver\Naming\NamingDirectory

Inheritance: extends AppserverIo\Storage\GenericStackable, implements AppserverIo\Psr\Naming\NamingDirectoryInterface, use trait AppserverIo\Appserver\Core\Traits\ThreadedContextTrait
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $name = null, AppserverIo\Psr\Naming\NamingDirectoryInterface $parent = null ) Initialize the directory with a name and the parent one.
__toString ( ) : string Returns a string representation of the naming directory
appendDirectory ( string $name ) : string Append's the passed name to the actual path and return's the new path.
bind ( string $name, mixed $value, array $args = [] ) : void Binds the passed instance with the name to the naming directory.
bindCallback ( string $name, callable $callback, array $args = [] ) : void Binds the passed callback with the name to the naming directory.
bindReference ( string $name, string $reference ) : void Binds a reference with the passed name to the naming directory.
containsScheme ( string $name ) : boolean Query whether the passed name contains the scheme or not.
createSubdirectory ( string $name, array $filter = [] ) : NamingDirectory Create and return a new naming subdirectory with the attributes of this one.
findRoot ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the root node of the naming directory tree.
getDirectory ( ) : string Return's the directory.
getIdentifier ( ) : string The unique identifier of this directory. That'll be build up recursive from the scheme and the root directory.
getName ( ) : string Returns the directory name.
getParent ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface Returns the parend directory.
getScheme ( ) : string Returns the scheme.
prepareDirectory ( string $name ) : The Prepare's and return's the path either by stripping of the scheme if it is absolute or append the name, if it is relative.
search ( string $name, array $args = [] ) : mixed Queries the naming directory for the requested name and returns the value or invokes the bound callback.
setDirectory ( string $name ) : void Set's the passed directory.
setScheme ( string $scheme ) : void Set the scheme, php or http for example
stripSchema ( string $name ) : string Strip off the schema and return the directory part only.
toArray ( array &$buffer = [] ) : array Builds an array with a string representation of the naming directories content.
unbind ( string $name ) : void Unbinds the named object from the naming directory.

Method Details

__construct() public méthode

Initialize the directory with a name and the parent one.
public __construct ( string $name = null, AppserverIo\Psr\Naming\NamingDirectoryInterface $parent = null )
$name string The directory name
$parent AppserverIo\Psr\Naming\NamingDirectoryInterface The parent directory

__toString() public méthode

Returns a string representation of the naming directory
public __toString ( ) : string
Résultat string The string representation of the naming directory

appendDirectory() public méthode

Append's the passed name to the actual path and return's the new path.
public appendDirectory ( string $name ) : string
$name string The name to append to the path
Résultat string The new path, with the name appended

bind() public méthode

Binds the passed instance with the name to the naming directory.
public bind ( string $name, mixed $value, array $args = [] ) : void
$name string The name to bind the value with
$value mixed The object instance to bind
$args array The array with the arguments
Résultat void

bindCallback() public méthode

Binds the passed callback with the name to the naming directory.
See also: AppserverIo\Appserver\Naming\NamingDirectory::bind()
public bindCallback ( string $name, callable $callback, array $args = [] ) : void
$name string The name to bind the callback with
$callback callable The callback to be invoked when searching for
$args array The array with the arguments passed to the callback when executed
Résultat void

bindReference() public méthode

Binds a reference with the passed name to the naming directory.
See also: AppserverIo\Appserver\Naming\NamingDirectory::bind()
public bindReference ( string $name, string $reference ) : void
$name string The name to bind the reference with
$reference string The name of the reference
Résultat void

containsScheme() public méthode

Query whether the passed name contains the scheme or not.
public containsScheme ( string $name ) : boolean
$name string The name to query for a scheme
Résultat boolean TRUE if the name contains the scheme, else FALSE

createSubdirectory() public méthode

Create and return a new naming subdirectory with the attributes of this one.
public createSubdirectory ( string $name, array $filter = [] ) : NamingDirectory
$name string The name of the new subdirectory
$filter array Array with filters that will be applied when copy the attributes
Résultat NamingDirectory The new naming subdirectory

findRoot() public méthode

Returns the root node of the naming directory tree.
Deprecation:
public findRoot ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
Résultat AppserverIo\Psr\Naming\NamingDirectoryInterface The root node

getDirectory() public méthode

Return's the directory.
public getDirectory ( ) : string
Résultat string The directory

getIdentifier() public méthode

The unique identifier of this directory. That'll be build up recursive from the scheme and the root directory.
See also: AppserverIo\Storage\StorageInterface::getIdentifier()
public getIdentifier ( ) : string
Résultat string The unique identifier

getName() public méthode

Returns the directory name.
public getName ( ) : string
Résultat string The directory name

getParent() public méthode

Returns the parend directory.
Deprecation:
public getParent ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
Résultat AppserverIo\Psr\Naming\NamingDirectoryInterface

getScheme() public méthode

Returns the scheme.
public getScheme ( ) : string
Résultat string The scheme we want to use

prepareDirectory() public méthode

Prepare's and return's the path either by stripping of the scheme if it is absolute or append the name, if it is relative.
public prepareDirectory ( string $name ) : The
$name string The name to prepare the directory with
Résultat The prepared path

setDirectory() public méthode

Set's the passed directory.
public setDirectory ( string $name ) : void
$name string The directory to set
Résultat void

setScheme() public méthode

Set the scheme, php or http for example
public setScheme ( string $scheme ) : void
$scheme string The scheme we want to use
Résultat void

stripSchema() public méthode

Strip off the schema and return the directory part only.
public stripSchema ( string $name ) : string
$name string The directory, maybe containing the scheme
Résultat string The directory without the scheme

toArray() public méthode

Builds an array with a string representation of the naming directories content.
public toArray ( array &$buffer = [] ) : array
$buffer array The array to append the values to
Résultat array The array with the naming directories string representation

unbind() public méthode

Unbinds the named object from the naming directory.
public unbind ( string $name ) : void
$name string The name of the object to unbind
Résultat void