PHP Класс AppserverIo\Appserver\Naming\NamingDirectory

Автор: Tim Wagner ([email protected])
Наследование: extends AppserverIo\Storage\GenericStackable, implements AppserverIo\Psr\Naming\NamingDirectoryInterface, use trait AppserverIo\Appserver\Core\Traits\ThreadedContextTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

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() публичный метод

Returns a string representation of the naming directory
public __toString ( ) : string
Результат string The string representation of the naming directory

appendDirectory() публичный метод

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
Результат string The new path, with the name appended

bind() публичный метод

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
Результат void

bindCallback() публичный метод

Binds the passed callback with the name to the naming directory.
См. также: 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
Результат void

bindReference() публичный метод

Binds a reference with the passed name to the naming directory.
См. также: 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
Результат void

containsScheme() публичный метод

Query whether the passed name contains the scheme or not.
public containsScheme ( string $name ) : boolean
$name string The name to query for a scheme
Результат boolean TRUE if the name contains the scheme, else FALSE

createSubdirectory() публичный метод

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
Результат NamingDirectory The new naming subdirectory

findRoot() публичный метод

Returns the root node of the naming directory tree.
Устаревший:
public findRoot ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
Результат AppserverIo\Psr\Naming\NamingDirectoryInterface The root node

getDirectory() публичный метод

Return's the directory.
public getDirectory ( ) : string
Результат string The directory

getIdentifier() публичный метод

The unique identifier of this directory. That'll be build up recursive from the scheme and the root directory.
См. также: AppserverIo\Storage\StorageInterface::getIdentifier()
public getIdentifier ( ) : string
Результат string The unique identifier

getName() публичный метод

Returns the directory name.
public getName ( ) : string
Результат string The directory name

getParent() публичный метод

Returns the parend directory.
Устаревший:
public getParent ( ) : AppserverIo\Psr\Naming\NamingDirectoryInterface
Результат AppserverIo\Psr\Naming\NamingDirectoryInterface

getScheme() публичный метод

Returns the scheme.
public getScheme ( ) : string
Результат string The scheme we want to use

prepareDirectory() публичный метод

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
Результат The prepared path

setDirectory() публичный метод

Set's the passed directory.
public setDirectory ( string $name ) : void
$name string The directory to set
Результат void

setScheme() публичный метод

Set the scheme, php or http for example
public setScheme ( string $scheme ) : void
$scheme string The scheme we want to use
Результат void

stripSchema() публичный метод

Strip off the schema and return the directory part only.
public stripSchema ( string $name ) : string
$name string The directory, maybe containing the scheme
Результат string The directory without the scheme

toArray() публичный метод

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
Результат array The array with the naming directories string representation

unbind() публичный метод

Unbinds the named object from the naming directory.
public unbind ( string $name ) : void
$name string The name of the object to unbind
Результат void