Documentation

PhpFileLoader extends FileLoader
in package

PhpFileLoader loads service definitions from a PHP file.

The PHP file is required and the $container variable can be used within the file to change the container.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

ANONYMOUS_ID_REGEXP  = '/^\.\d+_[^~]*+~[._a-zA-Z\d]{7}$/'
$autoRegisterAliasesForSinglyImplementedInterfaces  : mixed
$container  : mixed
$env  : mixed
$instanceof  : mixed
$interfaces  : mixed
$isLoadingInstanceof  : mixed
$loading  : mixed
$locator  : mixed
$resolver  : mixed
$singlyImplemented  : mixed
$currentDir  : mixed
$generator  : mixed
__construct()  : mixed
getLocator()  : FileLocatorInterface
Returns the file locator used by this loader.
getResolver()  : LoaderResolverInterface
Gets the loader resolver.
import()  : mixed
Imports a resource.
load()  : mixed
{@inheritdoc}
registerAliasesForSinglyImplementedInterfaces()  : mixed
registerClasses()  : mixed
Registers a set of classes as services using PSR-4 for discovery.
resolve()  : LoaderInterface
Finds a loader able to load an imported resource.
setCurrentDir()  : mixed
Sets the current directory.
setResolver()  : mixed
Sets the loader resolver.
supports()  : mixed
{@inheritdoc}
setDefinition()  : mixed
Registers a definition in the container with its instanceof-conditionals.
configBuilder()  : ConfigBuilderInterface
doImport()  : mixed
executeCallback()  : mixed
Resolve the parameters to the $callback and execute it.
findClasses()  : array<string|int, mixed>

Constants

ANONYMOUS_ID_REGEXP

public mixed ANONYMOUS_ID_REGEXP = '/^\.\d+_[^~]*+~[._a-zA-Z\d]{7}$/'

Properties

$autoRegisterAliasesForSinglyImplementedInterfaces

protected mixed $autoRegisterAliasesForSinglyImplementedInterfaces = false

$isLoadingInstanceof

protected mixed $isLoadingInstanceof = false

$resolver

protected mixed $resolver

$singlyImplemented

protected mixed $singlyImplemented = []

Methods

import()

Imports a resource.

public import(mixed $resource[, string|null $type = null ]) : mixed
Parameters
$resource : mixed

A resource

$type : string|null = null

The resource type or null if unknown

Return values
mixed

load()

{@inheritdoc}

public load(mixed $resource[, string|null $type = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null
Return values
mixed

registerAliasesForSinglyImplementedInterfaces()

public registerAliasesForSinglyImplementedInterfaces() : mixed
Return values
mixed

registerClasses()

Registers a set of classes as services using PSR-4 for discovery.

public registerClasses(Definition $prototype, string $namespace, string $resource[, string|array<string|int, string>|null $exclude = null ]) : mixed
Parameters
$prototype : Definition

A definition to use as template

$namespace : string

The namespace prefix of classes in the scanned directory

$resource : string

The directory to look for classes, glob-patterns allowed

$exclude : string|array<string|int, string>|null = null

A globbed path of files to exclude or an array of globbed paths of files to exclude

Return values
mixed

resolve()

Finds a loader able to load an imported resource.

public resolve(mixed $resource[, string|null $type = null ]) : LoaderInterface
Parameters
$resource : mixed

A resource

$type : string|null = null

The resource type or null if unknown

Tags
throws
LoaderLoadException

If no loader is found

Return values
LoaderInterface

setCurrentDir()

Sets the current directory.

public setCurrentDir(string $dir) : mixed
Parameters
$dir : string
Return values
mixed

supports()

{@inheritdoc}

public supports(mixed $resource[, string|null $type = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null
Return values
mixed

setDefinition()

Registers a definition in the container with its instanceof-conditionals.

protected setDefinition(string $id, Definition $definition) : mixed
Parameters
$id : string
$definition : Definition
Return values
mixed

doImport()

private doImport(mixed $resource[, string|null $type = null ][, bool $ignoreErrors = false ][, string|null $sourceResource = null ]) : mixed
Parameters
$resource : mixed
$type : string|null = null
$ignoreErrors : bool = false
$sourceResource : string|null = null
Return values
mixed

executeCallback()

Resolve the parameters to the $callback and execute it.

private executeCallback(callable $callback, ContainerConfigurator $containerConfigurator, string $path) : mixed
Parameters
$callback : callable
$containerConfigurator : ContainerConfigurator
$path : string
Return values
mixed

findClasses()

private findClasses(string $namespace, string $pattern, array<string|int, mixed> $excludePatterns, RegisterAutoconfigureAttributesPass|null $autoconfigureAttributes) : array<string|int, mixed>
Parameters
$namespace : string
$pattern : string
$excludePatterns : array<string|int, mixed>
$autoconfigureAttributes : RegisterAutoconfigureAttributesPass|null
Return values
array<string|int, mixed>

Search results