Documentation

SymfonyRuntime extends GenericRuntime
in package

Knows the basic conventions to run Symfony apps.

In addition to the options managed by GenericRuntime, it accepts the following options:

  • "env" to define the name of the environment the app runs in;
  • "disable_dotenv" to disable looking for .env files;
  • "dotenv_path" to define the path of dot-env files - defaults to ".env";
  • "prod_envs" to define the names of the production envs - defaults to ["prod"];
  • "test_envs" to define the names of the test envs - defaults to ["test"];
  • "use_putenv" to tell Dotenv to set env vars using putenv() (NOT RECOMMENDED.)
  • "dotenv_overload" to tell Dotenv to override existing vars

When the "debug" / "env" options are not defined, they will fallback to the "APP_DEBUG" / "APP_ENV" environment variables, and to the "--env|-e" / "--no-debug" command line arguments if "symfony/console" is installed.

When the "symfony/dotenv" component is installed, .env files are loaded. When "symfony/error-handler" is installed, it is registered in debug mode.

On top of the base arguments provided by GenericRuntime, this runtime can feed the app-callable with arguments of type:

  • Request from "symfony/http-foundation" if the component is installed;
  • Application, Command, InputInterface and/or OutputInterface from "symfony/console" if the component is installed.

This runtime can handle app-callables that return instances of either:

  • HttpKernelInterface,
  • Response,
  • Application,
  • Command,
  • int|string|null as handled by GenericRuntime.
Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Properties

$options  : mixed
$command  : mixed
$console  : mixed
$input  : mixed
$output  : mixed

Methods

__construct()  : mixed
getResolver()  : ResolverInterface
Returns a resolver that should compute the arguments of a callable.
getRunner()  : RunnerInterface
Returns a callable that knows how to run the passed object and that returns its exit status as int.
getArgument()  : mixed
register()  : GenericRuntime
getInput()  : ArgvInput
getRuntime()  : self|null
resolveRuntime()  : self|null

Properties

Methods

__construct()

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

getResolver()

Returns a resolver that should compute the arguments of a callable.

public getResolver(callable $callable[, ReflectionFunction $reflector = null ]) : ResolverInterface
Parameters
$callable : callable
$reflector : ReflectionFunction = null
Return values
ResolverInterface

getRunner()

Returns a callable that knows how to run the passed object and that returns its exit status as int.

public getRunner(object|null $application) : RunnerInterface
Parameters
$application : object|null
Return values
RunnerInterface

getArgument()

protected getArgument(ReflectionParameter $parameter, string|null $type) : mixed
Parameters
$parameter : ReflectionParameter
$type : string|null

getRuntime()

private getRuntime(string $type) : self|null
Parameters
$type : string
Return values
self|null

resolveRuntime()

private resolveRuntime(string $class) : self|null
Parameters
$class : string
Return values
self|null

        
On this page

Search results