PHP Класс Robo\Robo

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$container League\Container\ContainerInterface | null The currently active container object, or NULL if not initialized yet.

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

Метод Описание
addInflectors ( League\Container\ContainerInterface $container ) Add the Robo League\Container inflectors to the container
application ( ) : Robo\Application
config ( ) : Robo\Config
configureContainer ( League\Container\ContainerInterface $container, Application $app, robo\Config $config, null | Symfony\Component\Console\Input\InputInterface $input = null, null | Symfony\Component\Console\Output\OutputInterface $output = null ) Initialize a container with all of the default Robo services.
createDefaultApplication ( null | string $appName = null, null | string $appVersion = null ) : Robo\Application
createDefaultContainer ( null | Symfony\Component\Console\Input\InputInterface $input = null, null | Symfony\Component\Console\Output\OutputInterface $output = null, null | Robo\Application $app = null, null | Robo\Config $config = null ) : League\Container\Container | League\Container\ContainerInterface Create a container and initiailze it. If you wish to *change* anything defined in the container, then you should call \Robo::configureContainer() instead of this function.
getContainer ( ) : League\Container\ContainerInterface Returns the currently active global container.
hasContainer ( ) : boolean Returns TRUE if the container has been initialized, FALSE otherwise.
hasService ( string $id ) : boolean Indicates if a service is defined in the container.
input ( ) : Symfony\Component\Console\Input\InputInterface Return the input object.
logger ( ) : Consolidation\Log\Logger
output ( ) : Symfony\Component\Console\Output\OutputInterface Return the output object.
resultPrinter ( ) : Robo\Log\ResultPrinter Return the result printer object.
run ( string[] $argv, string $commandClasses, null | string $appName = null, null | string $appVersion = null, null | Symfony\Component\Console\Output\OutputInterface $output = null ) : integer Entrypoint for standalone Robo-based tools. See docs/framework.md.
service ( string $id ) : mixed Retrieves a service from the container.
setContainer ( League\Container\ContainerInterface $container ) Sets a new global container.
unsetContainer ( ) Unsets the global container.

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

addInflectors() публичный статический Метод

Add the Robo League\Container inflectors to the container
public static addInflectors ( League\Container\ContainerInterface $container )
$container League\Container\ContainerInterface

application() публичный статический Метод

public static application ( ) : Robo\Application
Результат Robo\Application

config() публичный статический Метод

public static config ( ) : Robo\Config
Результат Robo\Config

configureContainer() публичный статический Метод

IMPORTANT: after calling this method, clients MUST call: $dispatcher = $container->get('eventDispatcher'); $app->setDispatcher($dispatcher); Any modification to the container should be done prior to fetching objects from it. It is recommended to use \Robo::createDefaultContainer() instead, which does all required setup for the caller, but has the limitation that the container it creates can only be extended, not modified.
public static configureContainer ( League\Container\ContainerInterface $container, Application $app, robo\Config $config, null | Symfony\Component\Console\Input\InputInterface $input = null, null | Symfony\Component\Console\Output\OutputInterface $output = null )
$container League\Container\ContainerInterface
$app Symfony\Component\Console\Application
$config robo\Config
$input null | Symfony\Component\Console\Input\InputInterface
$output null | Symfony\Component\Console\Output\OutputInterface

createDefaultApplication() публичный статический Метод

public static createDefaultApplication ( null | string $appName = null, null | string $appVersion = null ) : Robo\Application
$appName null | string
$appVersion null | string
Результат Robo\Application

createDefaultContainer() публичный статический Метод

Create a container and initiailze it. If you wish to *change* anything defined in the container, then you should call \Robo::configureContainer() instead of this function.
public static createDefaultContainer ( null | Symfony\Component\Console\Input\InputInterface $input = null, null | Symfony\Component\Console\Output\OutputInterface $output = null, null | Robo\Application $app = null, null | Robo\Config $config = null ) : League\Container\Container | League\Container\ContainerInterface
$input null | Symfony\Component\Console\Input\InputInterface
$output null | Symfony\Component\Console\Output\OutputInterface
$app null | Robo\Application
$config null | Robo\Config
Результат League\Container\Container | League\Container\ContainerInterface

getContainer() публичный статический Метод

Returns the currently active global container.
public static getContainer ( ) : League\Container\ContainerInterface
Результат League\Container\ContainerInterface

hasContainer() публичный статический Метод

Returns TRUE if the container has been initialized, FALSE otherwise.
public static hasContainer ( ) : boolean
Результат boolean

hasService() публичный статический Метод

Indicates if a service is defined in the container.
public static hasService ( string $id ) : boolean
$id string The ID of the service to check.
Результат boolean TRUE if the specified service exists, FALSE otherwise.

input() публичный статический Метод

Return the input object.
public static input ( ) : Symfony\Component\Console\Input\InputInterface
Результат Symfony\Component\Console\Input\InputInterface

logger() публичный статический Метод

public static logger ( ) : Consolidation\Log\Logger
Результат Consolidation\Log\Logger

output() публичный статический Метод

Return the output object.
public static output ( ) : Symfony\Component\Console\Output\OutputInterface
Результат Symfony\Component\Console\Output\OutputInterface

resultPrinter() публичный статический Метод

Return the result printer object.
public static resultPrinter ( ) : Robo\Log\ResultPrinter
Результат Robo\Log\ResultPrinter

run() публичный статический Метод

Entrypoint for standalone Robo-based tools. See docs/framework.md.
public static run ( string[] $argv, string $commandClasses, null | string $appName = null, null | string $appVersion = null, null | Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$argv string[]
$commandClasses string
$appName null | string
$appVersion null | string
$output null | Symfony\Component\Console\Output\OutputInterface
Результат integer

service() публичный статический Метод

Use this method if the desired service is not one of those with a dedicated accessor method below. If it is listed below, those methods are preferred as they can return useful type hints.
public static service ( string $id ) : mixed
$id string The ID of the service to retrieve.
Результат mixed The specified service.

setContainer() публичный статический Метод

Sets a new global container.
public static setContainer ( League\Container\ContainerInterface $container )
$container League\Container\ContainerInterface A new container instance to replace the current.

unsetContainer() публичный статический Метод

Unsets the global container.
public static unsetContainer ( )

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

$container защищенное статическое свойство

The currently active container object, or NULL if not initialized yet.
protected static ContainerInterface,League\Container|null $container
Результат League\Container\ContainerInterface | null