Skip to content
Snippets Groups Projects
Verified Commit ddca3cac authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: allow specifing target plugin at boot

parent 46c06d49
No related branches found
No related tags found
2 merge requests!3improve into wp-hook and some additional unfinished things,!21.x
...@@ -48,13 +48,18 @@ final class Init { ...@@ -48,13 +48,18 @@ final class Init {
} }
} }
public function boot() { /**
* @param string|null $filename Filename of the booted plugin. May be null, if called from plugin's main file.
*/
public function boot( string? $filename = null ) {
if ( self::$bootable === false ) { if ( self::$bootable === false ) {
return; return;
} }
if ( $filename === null ) {
$backtrace = \debug_backtrace( \DEBUG_BACKTRACE_IGNORE_ARGS, 1 ); $backtrace = \debug_backtrace( \DEBUG_BACKTRACE_IGNORE_ARGS, 1 );
$filename = $backtrace[0]['file']; $filename = $backtrace[0]['file'];
}
$extensions = new ExtensionsSet( $extensions = new ExtensionsSet(
new BuiltinExtension(), new BuiltinExtension(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment