PHP 클래스 AppserverIo\Appserver\Naming\NamingDirectory

상속: extends AppserverIo\Storage\GenericStackable, implements AppserverIo\Psr\Naming\NamingDirectoryInterface, use trait AppserverIo\Appserver\Core\Traits\ThreadedContextTrait
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 메소드들

메소드 설명
__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