mirror of
https://github.com/flarum/framework.git
synced 2025-01-22 18:42:01 +08:00
Revert "Remove deprecated bootstrap.php fallback"
This reverts commit f8061bbca1
.
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
7f1048352d
commit
ed97989ca2
|
@ -257,9 +257,9 @@ class Extension implements Arrayable
|
|||
|
||||
private function getExtenders(): array
|
||||
{
|
||||
$extenderFile = "{$this->path}/extend.php";
|
||||
$extenderFile = $this->getExtenderFile();
|
||||
|
||||
if (! file_exists($extenderFile)) {
|
||||
if (! $extenderFile) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -285,6 +285,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…
Reference in New Issue
Block a user