deprecationWarning(string $version, string $message, int $stackFrame = 1): void
Helper method for outputting deprecation warnings
string
$version
The version that added this deprecation warning.
string
$message
The message to output as a deprecation warning.
int
$stackFrame
optional
The stack frame to include in the error. Defaults to 1 as that should point to application/plugin code.
void
env(string $key, string|bool|null $default = null): string|float|int|bool|null
Gets an environment variable from available sources, and provides emulation for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom environment information.
string
$key
Environment variable name.
string|bool|null
$default
optional
Specify a default value in case the environment variable is not defined.
string|float|int|bool|null
h(mixed $text, bool $double = true, string|null $charset = null): mixed
Convenience method for htmlspecialchars.
mixed
$text
Text to wrap through htmlspecialchars. Also works with arrays, and objects.
Arrays will be mapped and have all their elements escaped. Objects will be string cast if they
implement a __toString
method. Otherwise, the class name will be used.
Other scalar types will be returned unchanged.
bool
$double
optional
Encode existing html entities.
string|null
$charset
optional
Character set to use when escaping.
Defaults to config value in mb_internal_encoding()
or 'UTF-8'.
mixed
namespaceSplit(string $class): array<string>
Split the namespace from the classname.
Commonly used like list($namespace, $className) = namespaceSplit($class);
.
string
$class
The full class name, ie Cake\Core\App
.
array<string>
pj(mixed $var): mixed
JSON pretty print convenience function.
In terminals this will act similar to using json_encode() with JSON_PRETTY_PRINT directly, when not run on CLI
will also wrap <pre>
tags around the output of given variable. Similar to pr().
This function returns the same variable that was passed.
mixed
$var
Variable to print out.
mixed
pluginSplit(string $name, bool $dotAppend = false, string|null $plugin = null): array
Splits a dot syntax plugin name into its plugin and class name. If $name does not have a dot, then index 0 will be null.
Commonly used like
list($plugin, $name) = pluginSplit($name);
string
$name
The name you want to plugin split.
bool
$dotAppend
optional
Set to true if you want the plugin to have a '.' appended to it.
string|null
$plugin
optional
Optional default plugin to use if no plugin is found. Defaults to null.
array
pr(mixed $var): mixed
print_r() convenience function.
In terminals this will act similar to using print_r() directly, when not run on CLI
print_r() will also wrap <pre>
tags around the output of given variable. Similar to debug().
This function returns the same variable that was passed.
mixed
$var
Variable to print out.
mixed
triggerWarning(string $message): void
Triggers an E_USER_WARNING.
string
$message
The warning message.
void
An interface defining the methods that the console runner depend on.
Interface for applications that configure and use a dependency injection container.
Interface for the Dependency Injection Container in CakePHP applications
An interface defining the methods that the http server depend on.
Interface for Applications that leverage plugins & events.
Plugin Interface
App is responsible for resource location, and path management.
Base Plugin Class
Configuration class. Used for managing runtime configuration information.
Dependency Injection container
Acts as a registry/factory for objects.
Plugin is used to load and locate plugins.
Plugin Collection
Read-only wrapper for configuration data
Container ServiceProvider
Provides methods that allow other classes access to conventions based inflections.
A trait for reading and writing instance config
A trait that provides a set of static methods to manage configuration for classes that provide an adapter facade or need to have sets of configuration data registered and manipulated.