mirror of
https://github.com/flarum/core.git
synced 2025-06-27 05:04:51 +02:00
@ -284,19 +284,19 @@ class ExtensionManager
|
|||||||
->flatMap(function (Extension $extension) {
|
->flatMap(function (Extension $extension) {
|
||||||
$bootstrapper = $extension->getBootstrapperPath();
|
$bootstrapper = $extension->getBootstrapperPath();
|
||||||
if ($this->filesystem->exists($bootstrapper)) {
|
if ($this->filesystem->exists($bootstrapper)) {
|
||||||
$extenders = require $bootstrapper;
|
return (array) require $bootstrapper;
|
||||||
|
|
||||||
if (is_array($extenders)) {
|
|
||||||
return $extenders;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assume that the extension has not yet switched to the new
|
|
||||||
// bootstrap.php format, and wrap the callback in a Compat
|
|
||||||
// extender.
|
|
||||||
return [new Compat($extenders)];
|
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
})->map(function ($extender) {
|
||||||
|
// If an extension has not yet switched to the new bootstrap.php
|
||||||
|
// format, it might return a function (or more of them). We wrap
|
||||||
|
// these in a Compat extender to enjoy an unique interface.
|
||||||
|
if ($extender instanceof \Closure) {
|
||||||
|
return new Compat($extender);
|
||||||
|
} else {
|
||||||
|
return $extender;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user