Methods |
public
|
getAppName(): string
Get the name of the application
Get the name of the application
Implemented by
|
#
|
public
|
isProduction(): bool
Check if the application is running in a production environment
Check if the application is running in a production environment
Returns true if:
- the name of the current environment is
"production"
- the application is running from a Phar archive, or
- the application was installed with
composer --no-dev
Implemented by
|
#
|
public
|
getBasePath(): string
Get the application's base path
Get the application's base path
Implemented by
|
#
|
public
|
getCachePath(): string
Get a writable cache directory for the application
Get a writable cache directory for the application
Appropriate for replaceable data that should persist between runs to
improve performance.
Implemented by
|
#
|
public
|
getConfigPath(): string
Get a writable directory for configuration files created by the
application
Get a writable directory for configuration files created by the
application
Implemented by
|
#
|
public
|
getDataPath(): string
Get a writable data directory for the application
Get a writable data directory for the application
Appropriate for critical data that should persist indefinitely.
Implemented by
|
#
|
public
|
getLogPath(): string
Get a writable directory for the application's log files
Get a writable directory for the application's log files
Implemented by
|
#
|
public
|
getTempPath(): string
Get a writable directory for the application's ephemeral data
Get a writable directory for the application's ephemeral data
Implemented by
|
#
|
public
|
logOutput(string|null $name = null, ?bool $debug = null): $this
Log console output to the application's log directory
Log console output to the application's log directory
Messages with levels between {@see Level::EMERGENCY} and
{@see Level::INFO} are written to <name>.log .
If $debug is true , or $debug is null and debug mode is enabled in
the environment, messages with levels between {@see Level::EMERGENCY} and
{@see Level::DEBUG} are simultaneously written to <name>.debug.log .
Parameters
$name |
If null , the name of the application is used.
|
Implemented by
|
#
|
public
|
exportHar(
string|null $name = null,
?string $creatorName = null,
?string $creatorVersion = null,
(Closure(): string)|string|null $uuid = null,
): $this
Export the application's HTTP requests to an HTTP Archive (HAR) file in
its log directory
Export the application's HTTP requests to an HTTP Archive (HAR) file in
its log directory
If any requests are made via {@see CurlerInterface} objects,
<name>-<timestamp>-<uuid>.har is created to record them.
Parameters
$name |
If null , the name of the application is used.
|
Throws
Implemented by
|
#
|
public
|
getHarFilename(): ?string
Get the name of the HTTP Archive (HAR) file created via exportHar() if it
has been created
Get the name of the HTTP Archive (HAR) file created via exportHar() if it
has been created
Throws
Implemented by
|
#
|
public
|
startCache(): $this
Start a cache store and make it the global cache
Start a cache store and make it the global cache
If the cache store is filesystem-backed, the application's cache
directory is used.
Implemented by
|
#
|
public
|
resumeCache(): $this
Start a cache store and make it the global cache if a previously started
cache store exists, otherwise do nothing
Start a cache store and make it the global cache if a previously started
cache store exists, otherwise do nothing
Implemented by
|
#
|
public
|
stopCache(): $this
Stop a cache store started by startCache() or resumeCache()
Stop a cache store started by startCache() or resumeCache()
Implemented by
|
#
|
public
|
startSync(?string $command = null, mixed[]|null $arguments = null): $this
Start an entity store and make it the global sync entity store
Start an entity store and make it the global sync entity store
If the entity store is filesystem-backed, the application's data
directory is used.
Implemented by
|
#
|
public
|
stopSync(): $this
Stop an entity store started by startSync()
Stop an entity store started by startSync()
Implemented by
|
#
|
public
|
registerSyncNamespace(
string $prefix,
string $uri,
string $namespace,
?SyncNamespaceHelperInterface $helper = null,
): $this
Register a namespace for sync entities and their provider interfaces with
the global sync entity store
Register a namespace for sync entities and their provider interfaces with
the global sync entity store
Throws
Implemented by
|
#
|
public
|
getWorkingDirectory(): string
Get the application's working directory
Get the application's working directory
The application's working directory is either the directory it was
started in, or the directory most recently set via
{@see ApplicationInterface::setWorkingDirectory()}.
Implemented by
|
#
|
public
|
restoreWorkingDirectory(): $this
Change to the application's working directory
Change to the application's working directory
Implemented by
|
#
|
public
|
setWorkingDirectory(string|null $directory = null): $this
Set the application's working directory
Set the application's working directory
Parameters
$directory |
If null , the current working directory is
used.
|
Implemented by
|
#
|
public
|
registerShutdownReport(
MessageLevel::* $level = MessageLevel::INFO,
bool $includeResourceUsage = true,
bool $includeRunningTimers = true,
string[]|string|null $groups = null,
?int $limit = 10,
): $this
Print a summary of the application's runtime performance metrics and
system resource usage when it terminates
Print a summary of the application's runtime performance metrics and
system resource usage when it terminates
Parameters
$groups |
If null or ["*"] , all metrics are
reported, otherwise only metrics in the given groups are reported.
|
Implemented by
|
#
|
public
|
reportResourceUsage(MessageLevel::* $level = MessageLevel::INFO): $this
Print a summary of the application's system resource usage
Print a summary of the application's system resource usage
Implemented by
|
#
|
public
|
reportMetrics(
MessageLevel::* $level = MessageLevel::INFO,
bool $includeRunningTimers = true,
string[]|string|null $groups = null,
?int $limit = 10,
): $this
Print a summary of the application's runtime performance metrics
Print a summary of the application's runtime performance metrics
Parameters
$groups |
If null or ["*"] , all metrics are
reported, otherwise only metrics in the given groups are reported.
|
Implemented by
|
#
|