ContainerUtil
in package
implements
ServiceSubscriberInterface
Table of Contents
Interfaces
- ServiceSubscriberInterface
Properties
- $filesystem : Filesystem
- $framework : ContaoFramework
- $kernel : KernelInterface
- $locator : ContainerInterface
- $requestStack : RequestStack
- $scopeMatcher : ScopeMatcher
- $tokenChecker : TokenChecker
Methods
- __construct() : mixed
- getBundlePath() : string|null
- Returns the path to the bundle in vendor folder Attention: resolves symlinks!
- getBundleResourcePath() : string|array<string|int, mixed>|null
- Returns the path or paths to a ressource within a bundle Attention: resolves symlinks!
- getSubscribedServices() : array<string|int, mixed>
- isBackend() : bool
- Return if currently in backend scope.
- isDev() : bool
- Return if in dev environment.
- isFrontend() : bool
- Return if currently in frontend scope.
- isFrontendCron() : bool
- Return if in cron route (Attention: not cron command!).
- isInstall() : bool
- Return if in install route (Attention: not migration!).
- isMaintenanceModeActive() : bool
- Return if currently in maintenance mode.
- isPreviewMode() : bool
- Return if currently in preview mode.
- log() : void
- Add a log entry to contao system log.
Properties
$filesystem read-only
private
Filesystem
$filesystem
$framework read-only
private
ContaoFramework
$framework
$kernel read-only
private
KernelInterface
$kernel
$locator read-only
private
ContainerInterface
$locator
$requestStack read-only
private
RequestStack
$requestStack
$scopeMatcher read-only
private
ScopeMatcher
$scopeMatcher
$tokenChecker read-only
private
TokenChecker
$tokenChecker
Methods
__construct()
public
__construct(ContainerInterface $locator, KernelInterface $kernel, ContaoFramework $framework, ScopeMatcher $scopeMatcher, RequestStack $requestStack, Filesystem $filesystem, TokenChecker $tokenChecker) : mixed
Parameters
- $locator : ContainerInterface
- $kernel : KernelInterface
- $framework : ContaoFramework
- $scopeMatcher : ScopeMatcher
- $requestStack : RequestStack
- $filesystem : Filesystem
- $tokenChecker : TokenChecker
getBundlePath()
Returns the path to the bundle in vendor folder Attention: resolves symlinks!
public
getBundlePath(string $bundleClass) : string|null
Parameters
- $bundleClass : string
-
The bundle class class constant (VendorMyBundle::class)
Return values
string|null —False on error
getBundleResourcePath()
Returns the path or paths to a ressource within a bundle Attention: resolves symlinks!
public
getBundleResourcePath(string $bundleClass[, string $ressourcePath = '' ][, bool $first = false ]) : string|array<string|int, mixed>|null
Parameters
- $bundleClass : string
-
The bundle class class constant (VendorMyBundle::class)
- $ressourcePath : string = ''
-
a ressource or path to ressource
- $first : bool = false
-
Returns only first occurrence if multiple paths found
Return values
string|array<string|int, mixed>|null —False on error
getSubscribedServices()
public
static getSubscribedServices() : array<string|int, mixed>
Return values
array<string|int, mixed>isBackend()
Return if currently in backend scope.
public
isBackend() : bool
Return values
boolisDev()
Return if in dev environment.
public
isDev() : bool
Return values
boolisFrontend()
Return if currently in frontend scope.
public
isFrontend() : bool
Return values
boolisFrontendCron()
Return if in cron route (Attention: not cron command!).
public
isFrontendCron() : bool
Return values
boolisInstall()
Return if in install route (Attention: not migration!).
public
isInstall() : bool
Return values
boolisMaintenanceModeActive()
Return if currently in maintenance mode.
public
isMaintenanceModeActive([PageModel $page = null ]) : bool
Parameters
- $page : PageModel = null
Return values
boolisPreviewMode()
Return if currently in preview mode.
public
isPreviewMode() : bool
Use TokenChecker::isPreviewMode() instead
Return values
boollog()
Add a log entry to contao system log.
public
log(string $text, string $function, string $category) : void
Parameters
- $text : string
-
The log message
- $function : string
-
The function name. Typically METHOD
- $category : string
-
The category name. Use constants in ContaoContext