PHP Класс AppserverIo\Appserver\Core\InitialContext

Автор: Tim Wagner ([email protected])
Наследование: implements AppserverIo\Appserver\Application\Interfaces\ContextInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$classLoader AppserverIo\Appserver\Core\SplClassLoader The server's classLoading instance
$storage AppserverIo\Storage\StorageInterface The storage instance
$systemLogger Psr\Log\LoggerInterface The server's system logger instance.

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

Метод Описание
__construct ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) Initializes the context with the connection to the storage backend.
getAttribute ( string $key ) : mixed Returns the value with the passed key from the initial context.
getLogger ( string $loggerName ) : Psr\Log\LoggerInterface | null Gets the logger by given name
getLoggers ( ) : array Return
getStorage ( ) : AppserverIo\Storage\StorageInterface Returns the storage instance.
getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface Returns the system configuration.
getSystemLogger ( ) : Psr\Log\LoggerInterface Returns the system logger instance.
newInstance ( string $className, array $args = [] ) : object Returns a new instance of the passed class name.
newReflectionClass ( string $className ) : ReflectionClass Returns a reflection class instance for the passed class name.
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface Returns a new instance of the passed API service.
removeAttribute ( string $key ) : void Removes the attribute with the passed key from the initial context.
setAttribute ( string $key, mixed $value ) : void Stores the passed key value pair in the initial context.
setLoggers ( array $loggers ) : void Set's logger array
setStorage ( AppserverIo\Storage\StorageInterface $storage ) : AppserverIo\Storage\StorageInterface Returns the storage instance.
setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : void Adds the system configuration to the initial context.
setSystemLogger ( Psr\Log\LoggerInterface $systemLogger ) : void Set's the system logger instance.

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

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

Initializes the context with the connection to the storage backend.
public __construct ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration )
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

getAttribute() публичный Метод

Returns the value with the passed key from the initial context.
public getAttribute ( string $key ) : mixed
$key string The key of the value to return
Результат mixed The value stored in the initial context

getLogger() публичный Метод

Gets the logger by given name
public getLogger ( string $loggerName ) : Psr\Log\LoggerInterface | null
$loggerName string the loggers name
Результат Psr\Log\LoggerInterface | null The logger instance

getLoggers() публичный Метод

Return
public getLoggers ( ) : array
Результат array

getStorage() публичный Метод

Returns the storage instance.
public getStorage ( ) : AppserverIo\Storage\StorageInterface
Результат AppserverIo\Storage\StorageInterface The storage instance

getSystemConfiguration() публичный Метод

Returns the system configuration.
public getSystemConfiguration ( ) : AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface
Результат AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration

getSystemLogger() публичный Метод

Returns the system logger instance.
public getSystemLogger ( ) : Psr\Log\LoggerInterface
Результат Psr\Log\LoggerInterface

newInstance() публичный Метод

Returns a new instance of the passed class name.
public newInstance ( string $className, array $args = [] ) : object
$className string The fully qualified class name to return the instance for
$args array Arguments to pass to the constructor of the instance
Результат object The instance itself

newReflectionClass() публичный Метод

Returns a reflection class instance for the passed class name.
public newReflectionClass ( string $className ) : ReflectionClass
$className string The class name to return the reflection instance for
Результат ReflectionClass The reflection instance

newService() публичный Метод

Returns a new instance of the passed API service.
public newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$className string The API service class name to return the instance for
Результат AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

removeAttribute() публичный Метод

Removes the attribute with the passed key from the initial context.
public removeAttribute ( string $key ) : void
$key string The key of the value to delete
Результат void

setAttribute() публичный Метод

Stores the passed key value pair in the initial context.
public setAttribute ( string $key, mixed $value ) : void
$key string The key to store the value under
$value mixed The value to add to the initial context
Результат void

setLoggers() публичный Метод

Set's logger array
public setLoggers ( array $loggers ) : void
$loggers array The loggers array to set
Результат void

setStorage() публичный Метод

Returns the storage instance.
public setStorage ( AppserverIo\Storage\StorageInterface $storage ) : AppserverIo\Storage\StorageInterface
$storage AppserverIo\Storage\StorageInterface A storage instance
Результат AppserverIo\Storage\StorageInterface The storage instance

setSystemConfiguration() публичный Метод

Adds the system configuration to the initial context.
public setSystemConfiguration ( AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface $systemConfiguration ) : void
$systemConfiguration AppserverIo\Appserver\Core\Interfaces\SystemConfigurationInterface The system configuration
Результат void

setSystemLogger() публичный Метод

Set's the system logger instance.
public setSystemLogger ( Psr\Log\LoggerInterface $systemLogger ) : void
$systemLogger Psr\Log\LoggerInterface The system logger
Результат void

Описание свойств

$classLoader защищенное свойство

The server's classLoading instance
protected SplClassLoader,AppserverIo\Appserver\Core $classLoader
Результат AppserverIo\Appserver\Core\SplClassLoader

$storage защищенное свойство

The storage instance
protected StorageInterface,AppserverIo\Storage $storage
Результат AppserverIo\Storage\StorageInterface

$systemLogger защищенное свойство

The server's system logger instance.
protected LoggerInterface,Psr\Log $systemLogger
Результат Psr\Log\LoggerInterface