Plugin
Class.
Boots the framework for a plugin and provides its paths.
The instance is created only by boot() and handed to the container as a predefined instance: the container never builds it, but services of a plugin can inject it to read the paths.
Methods
boot()
Boots the framework. Called once from the main plugin file:
Plugin::boot(__FILE__). The main file must be {slug}/{slug}.php.
Release mode applies if the plugin contains generated/manifest.php (created
only by the release build). Caches live in wp-content/cache/{slug}. Templates
are looked up in overrides/{slug}/ of the child theme and the theme
before the plugin's own src/. At its end, boot() fires the action
wp_app_framework/init/{slug}.
getDirectory()
Directory of the plugin below WP_PLUGIN_DIR.
Returns string
getDirectoryUri()
URL of the plugin directory, without trailing slash.
Returns string
getFile()
The main plugin file, as passed to boot() (__FILE__; a real path if the plugin is a symlink).
Returns string
getFrameworkDirectory()
Filesystem path of the framework package; never derive URLs from it.
Returns string
getSlug()
Directory name of the plugin; it names everything global of the framework instance.
Returns non-empty-string