mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 06:39:40 +08:00
Revert "Remove deprecated bootstrap.php fallback"
This reverts commit f8061bbca13b0cbaea418acedc03c008bbf8edcb. We will keep this fallback in place, to avoid unnecessary breakage of backwards compatibility for extension authors. Removal is planned for the final 0.1 release.
This commit is contained in:
parent
627724839d
commit
64b53fb0ac
@ -255,9 +255,9 @@ class Extension implements Arrayable
|
||||
|
||||
private function getExtenders(): array
|
||||
{
|
||||
$extenderFile = "{$this->path}/extend.php";
|
||||
$extenderFile = $this->getExtenderFile();
|
||||
|
||||
if (! file_exists($extenderFile)) {
|
||||
if (! $extenderFile) {
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -283,6 +283,24 @@ class Extension implements Arrayable
|
||||
);
|
||||
}
|
||||
|
||||
private function getExtenderFile(): ?string
|
||||
{
|
||||
$filename = "{$this->path}/extend.php";
|
||||
|
||||
if (file_exists($filename)) {
|
||||
return $filename;
|
||||
}
|
||||
|
||||
// To give extension authors some time to migrate to the new extension
|
||||
// format, we will also fallback to the old bootstrap.php name. Consider
|
||||
// this feature deprecated.
|
||||
$deprecatedFilename = "{$this->path}/bootstrap.php";
|
||||
|
||||
if (file_exists($deprecatedFilename)) {
|
||||
return $deprecatedFilename;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether the extension has assets.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user