[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch

title

Body

[close]

/vendor/symfony/dependency-injection/ -> ContainerBuilder.php (summary)

(no description)

File Size: 1694 lines (56 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ContainerBuilder:: (71 methods):
  __construct()
  setResourceTracking()
  isTrackingResources()
  setProxyInstantiator()
  registerExtension()
  getExtension()
  getExtensions()
  hasExtension()
  getResources()
  addResource()
  setResources()
  addObjectResource()
  addClassResource()
  getReflectionClass()
  fileExists()
  loadFromExtension()
  addCompilerPass()
  getCompilerPassConfig()
  getCompiler()
  set()
  removeDefinition()
  has()
  get()
  doGet()
  merge()
  getExtensionConfig()
  prependExtensionConfig()
  compile()
  getServiceIds()
  getRemovedIds()
  addAliases()
  setAliases()
  setAlias()
  removeAlias()
  hasAlias()
  getAliases()
  getAlias()
  register()
  autowire()
  addDefinitions()
  setDefinitions()
  getDefinitions()
  setDefinition()
  hasDefinition()
  getDefinition()
  findDefinition()
  createService()
  resolveServices()
  doResolveServices()
  findTaggedServiceIds()
  findTags()
  findUnusedTags()
  addExpressionLanguageProvider()
  getExpressionLanguageProviders()
  registerForAutoconfiguration()
  getAutoconfiguredInstanceof()
  resolveEnvPlaceholders()
  getEnvCounters()
  getNormalizedIds()
  log()
  normalizeId()
  getRemovedBindingIds()
  removeBindings()
  getServiceConditionals()
  getInitializedConditionals()
  hash()
  getEnv()
  callMethod()
  shareService()
  getExpressionLanguage()
  inVendors()


Class: ContainerBuilder  - X-Ref

ContainerBuilder is a DI container that provides an API to easily describe services.

__construct(ParameterBagInterface $parameterBag = null)   X-Ref


setResourceTracking($track)   X-Ref
Sets the track resources flag.

If you are not using the loaders and therefore don't want
to depend on the Config component, set this flag to false.

param: bool $track True if you want to track resources, false otherwise

isTrackingResources()   X-Ref
Checks if resources are tracked.

return: bool true If resources are tracked, false otherwise

setProxyInstantiator(InstantiatorInterface $proxyInstantiator)   X-Ref
Sets the instantiator to be used when fetching proxies.


registerExtension(ExtensionInterface $extension)   X-Ref
No description

getExtension($name)   X-Ref
Returns an extension by alias or namespace.

return: ExtensionInterface An extension instance
param: string $name An alias or a namespace

getExtensions()   X-Ref
Returns all registered extensions.

return: ExtensionInterface[] An array of ExtensionInterface

hasExtension($name)   X-Ref
Checks if we have an extension.

return: bool If the extension exists
param: string $name The name of the extension

getResources()   X-Ref
Returns an array of resources loaded to build this configuration.

return: ResourceInterface[] An array of resources

addResource(ResourceInterface $resource)   X-Ref

return: $this

setResources(array $resources)   X-Ref
Sets the resources for this configuration.

return: $this
param: ResourceInterface[] $resources An array of resources

addObjectResource($object)   X-Ref
Adds the object class hierarchy as resources.

return: $this
param: object|string $object An object instance or class name

addClassResource(\ReflectionClass $class)   X-Ref
Adds the given class hierarchy as resources.

return: $this

getReflectionClass($class, $throw = true)   X-Ref
Retrieves the requested reflection class and registers it for resource tracking.

return: \ReflectionClass|null
param: string $class
param: bool   $throw

fileExists($path, $trackContents = true)   X-Ref
Checks whether the requested file or directory exists and registers the result for resource tracking.

return: bool
param: string      $path          The file or directory path for which to check the existence
param: bool|string $trackContents Whether to track contents of the given resource. If a string is passed,

loadFromExtension($extension, array $values = null)   X-Ref
Loads the configuration for an extension.

return: $this
param: string $extension The extension alias or namespace
param: array  $values    An array of values that customizes the extension

addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)   X-Ref
Adds a compiler pass.

return: $this
param: CompilerPassInterface $pass     A compiler pass
param: string                $type     The type of compiler pass
param: int                   $priority Used to sort the passes

getCompilerPassConfig()   X-Ref
Returns the compiler pass config which can then be modified.

return: PassConfig The compiler pass config

getCompiler()   X-Ref
Returns the compiler.

return: Compiler The compiler

set($id, $service)   X-Ref
Sets a service.

param: string      $id      The service identifier
param: object|null $service The service instance

removeDefinition($id)   X-Ref
Removes a service definition.

param: string $id The service identifier

has($id)   X-Ref
Returns true if the given service is defined.

return: bool true if the service is defined, false otherwise
param: string $id The service identifier

get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)   X-Ref
Gets a service.

return: object|null The associated service
param: string $id              The service identifier
param: int    $invalidBehavior The behavior when the service does not exist

doGet($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, array &$inlineServices = null, $isConstructorArgument = false)   X-Ref
No description

merge(self $container)   X-Ref
Merges a ContainerBuilder with the current ContainerBuilder configuration.

Service definitions overrides the current defined ones.

But for parameters, they are overridden by the current ones. It allows
the parameters passed to the container constructor to have precedence
over the loaded ones.

$container = new ContainerBuilder(new ParameterBag(['foo' => 'bar']));
$loader = new LoaderXXX($container);
$loader->load('resource_name');
$container->register('foo', 'stdClass');

In the above example, even if the loaded resource defines a foo
parameter, the value will still be 'bar' as defined in the ContainerBuilder
constructor.


getExtensionConfig($name)   X-Ref
Returns the configuration array for the given extension.

return: array An array of configuration
param: string $name The name of the extension

prependExtensionConfig($name, array $config)   X-Ref
Prepends a config array to the configs of the given extension.

param: string $name   The name of the extension
param: array  $config The config to set

compile()   X-Ref
Compiles the container.

This method passes the container to compiler
passes whose job is to manipulate and optimize
the container.

The main compiler passes roughly do four things:

* The extension configurations are merged;
* Parameter values are resolved;
* The parameter bag is frozen;
* Extension loading is disabled.

param: bool $resolveEnvPlaceholders Whether %env()% parameters should be resolved using the current

getServiceIds()   X-Ref
{@inheritdoc}


getRemovedIds()   X-Ref
Gets removed service or alias ids.

return: array

addAliases(array $aliases)   X-Ref
Adds the service aliases.


setAliases(array $aliases)   X-Ref
Sets the service aliases.


setAlias($alias, $id)   X-Ref
Sets an alias for an existing service.

return: Alias
param: string       $alias The alias to create
param: string|Alias $id    The service to alias

removeAlias($alias)   X-Ref
Removes an alias.

param: string $alias The alias to remove

hasAlias($id)   X-Ref
Returns true if an alias exists under the given identifier.

return: bool true if the alias exists, false otherwise
param: string $id The service identifier

getAliases()   X-Ref
Gets all defined aliases.

return: Alias[] An array of aliases

getAlias($id)   X-Ref
Gets an alias.

return: Alias An Alias instance
param: string $id The service identifier

register($id, $class = null)   X-Ref
Registers a service definition.

This methods allows for simple registration of service definition
with a fluid interface.

return: Definition A Definition instance
param: string      $id    The service identifier
param: string|null $class The service class

autowire($id, $class = null)   X-Ref
Registers an autowired service definition.

This method implements a shortcut for using setDefinition() with
an autowired definition.

return: Definition The created definition
param: string      $id    The service identifier
param: string|null $class The service class

addDefinitions(array $definitions)   X-Ref
Adds the service definitions.

param: Definition[] $definitions An array of service definitions

setDefinitions(array $definitions)   X-Ref
Sets the service definitions.

param: Definition[] $definitions An array of service definitions

getDefinitions()   X-Ref
Gets all service definitions.

return: Definition[] An array of Definition instances

setDefinition($id, Definition $definition)   X-Ref
Sets a service definition.

return: Definition the service definition
param: string     $id         The service identifier
param: Definition $definition A Definition instance

hasDefinition($id)   X-Ref
Returns true if a service definition exists under the given identifier.

return: bool true if the service definition exists, false otherwise
param: string $id The service identifier

getDefinition($id)   X-Ref
Gets a service definition.

return: Definition A Definition instance
param: string $id The service identifier

findDefinition($id)   X-Ref
Gets a service definition by id or alias.

The method "unaliases" recursively to return a Definition instance.

return: Definition A Definition instance
param: string $id The service identifier or alias

createService(Definition $definition, array &$inlineServices, $isConstructorArgument = false, $id = null, $tryProxy = true)   X-Ref
Creates a service for a service definition.

return: mixed The service described by the service definition
param: Definition $definition A service definition instance
param: string     $id         The service identifier
param: bool       $tryProxy   Whether to try proxying the service with a lazy proxy

resolveServices($value)   X-Ref
Replaces service references by the real service instance and evaluates expressions.

return: mixed The same value with all service references replaced by
param: mixed $value A value

doResolveServices($value, array &$inlineServices = [], $isConstructorArgument = false)   X-Ref
No description

findTaggedServiceIds($name, $throwOnAbstract = false)   X-Ref
Returns service ids for a given tag.

Example:

$container->register('foo')->addTag('my.tag', ['hello' => 'world']);

$serviceIds = $container->findTaggedServiceIds('my.tag');
foreach ($serviceIds as $serviceId => $tags) {
foreach ($tags as $tag) {
echo $tag['hello'];
}
}

return: array An array of tags with the tagged service as key, holding a list of attribute arrays
param: string $name
param: bool   $throwOnAbstract

findTags()   X-Ref
Returns all tags the defined services use.

return: array An array of tags

findUnusedTags()   X-Ref
Returns all tags not queried by findTaggedServiceIds.

return: string[] An array of tags

addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)   X-Ref
No description

getExpressionLanguageProviders()   X-Ref

return: ExpressionFunctionProviderInterface[]

registerForAutoconfiguration($interface)   X-Ref
Returns a ChildDefinition that will be used for autoconfiguring the interface/class.

return: ChildDefinition
param: string $interface The class or interface to match

getAutoconfiguredInstanceof()   X-Ref
Returns an array of ChildDefinition[] keyed by interface.

return: ChildDefinition[]

resolveEnvPlaceholders($value, $format = null, array &$usedEnvs = null)   X-Ref
Resolves env parameter placeholders in a string or an array.

return: mixed The value with env parameters resolved if a string or an array is passed
param: mixed            $value     The value to resolve
param: string|true|null $format    A sprintf() format returning the replacement for each env var name or
param: array            &$usedEnvs Env vars found while resolving are added to this array

getEnvCounters()   X-Ref
Get statistics about env usage.

return: int[] The number of time each env vars has been resolved

getNormalizedIds()   X-Ref


log(CompilerPassInterface $pass, $message)   X-Ref


normalizeId($id)   X-Ref
{@inheritdoc}


getRemovedBindingIds()   X-Ref
Gets removed binding ids.

return: array

removeBindings($id)   X-Ref
Removes bindings for a service.

param: string $id The service identifier

getServiceConditionals($value)   X-Ref
Returns the Service Conditionals.

return: array An array of Service conditionals
param: mixed $value An array of conditionals to return

getInitializedConditionals($value)   X-Ref
Returns the initialized conditionals.

return: array An array of uninitialized conditionals
param: mixed $value An array of conditionals to return

hash($value)   X-Ref
Computes a reasonably unique hash of a value.

return: string
param: mixed $value A serializable value

getEnv($name)   X-Ref
{@inheritdoc}


callMethod($service, $call, array &$inlineServices)   X-Ref
No description

shareService(Definition $definition, $service, $id, array &$inlineServices)   X-Ref
Shares a given service in the container.

param: mixed       $service
param: string|null $id

getExpressionLanguage()   X-Ref
No description

inVendors($path)   X-Ref
No description



Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1