Robo
class Robo (View source)
Manages the container reference and other static data. Favor using dependency injection wherever possible. Avoid using this class directly, unless setting up a custom DI container.
Constants
APPLICATION_NAME |
|
private VERSION |
|
Properties
static protected ContainerInterface|null | $container | The currently active container object, or NULL if not initialized yet. |
Methods
Entrypoint for standalone Robo-based tools. See docs/framework.md.
Only provide access to the Robo version via Robo::version() so that roave/backward-compatibility-check does not complain about b/c breaks when the version number changes.
Sets a new global container.
Unsets the global container.
Returns the currently active global container.
Returns TRUE if the container has been initialized, FALSE otherwise.
Create a config object and load it from the provided paths.
Use a simple config loader to load configuration values from specified paths
Create a container for Robo application.
Create a container and initiailze it. If you wish to change anything defined in the container, then you should call Robo::createContainer() and Robo::finalizeContainer() instead of this function.
Do final initialization to the provided container. Make any necessary modifications to the container before calling this method.
Adds a shared instance to the container. This is to support 3.x and 4.x of league/container.
Initialize a container with all of the default Robo services.
No description
Add the Robo League\Container inflectors to the container
Retrieves a service from the container.
Indicates if a service is defined in the container.
No description
No description
No description
Return the output object.
Return the input object.
No description
No description
Details
static int
run(string[] $argv, string $commandClasses, null|string $appName = null, null|string $appVersion = null, null|OutputInterface $output = null, null|string $repository = null)
Entrypoint for standalone Robo-based tools. See docs/framework.md.
static
version()
Only provide access to the Robo version via Robo::version() so that roave/backward-compatibility-check does not complain about b/c breaks when the version number changes.
static
setContainer(ContainerInterface $container)
Sets a new global container.
static
unsetContainer()
Unsets the global container.
static ContainerInterface
getContainer()
Returns the currently active global container.
static bool
hasContainer()
Returns TRUE if the container has been initialized, FALSE otherwise.
static ConfigInterface
createConfiguration(string[] $paths)
Create a config object and load it from the provided paths.
static
loadConfiguration(string[] $paths, null|ConfigInterface $config = null)
Use a simple config loader to load configuration values from specified paths
static ContainerInterface
createContainer(null|Application $app = null, null|ConfigInterface $config = null, null|ClassLoader $classLoader = null)
Create a container for Robo application.
After calling this method you may add any additional items you wish to manage in your application. After you do that, you must call Robo::finalizeContainer($container) to complete container initialization.
static ContainerInterface
createDefaultContainer(null|InputInterface $input = null, null|OutputInterface $output = null, null|Application $app = null, null|ConfigInterface $config = null, null|ClassLoader $classLoader = null)
deprecated
deprecated
Create a container and initiailze it. If you wish to change anything defined in the container, then you should call Robo::createContainer() and Robo::finalizeContainer() instead of this function.
static
finalizeContainer(ContainerInterface $container)
Do final initialization to the provided container. Make any necessary modifications to the container before calling this method.
static DefinitionInterface
addShared(ContainerInterface $container, string $id, mixed $concrete)
Adds a shared instance to the container. This is to support 3.x and 4.x of league/container.
static
configureContainer(ContainerInterface $container, Application $app, ConfigInterface $config, null|InputInterface $input = null, null|OutputInterface $output = null, null|ClassLoader $classLoader = null)
Initialize a container with all of the default Robo services.
IMPORTANT: after calling this method, clients MUST call:
Robo::finalizeContainer($container);
Any modification to the container should be done prior to fetching objects from it.
It is recommended to use Robo::createContainer() instead.
static Application
createDefaultApplication(null|string $appName = null, null|string $appVersion = null)
No description
static
addInflectors(ContainerInterface $container)
Add the Robo League\Container inflectors to the container
static mixed
service(string $id)
Retrieves a service from the container.
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.
static bool
hasService(string $id)
Indicates if a service is defined in the container.
static ResultPrinter
resultPrinter()
deprecated
deprecated
Return the result printer object.
static ConfigInterface
config()
No description
static Logger
logger()
No description
static Application
application()
No description
static OutputInterface
output()
Return the output object.
static InputInterface
input()
Return the input object.
static ProcessExecutor
process(Process $process)
No description
static array
register(Application $app, $handlers)
No description
static protected null|object
registerSingle(Application $app, string|object $handler)
No description
static null|object
instantiate(string|object $handler)
No description