Revert "Remove deprecated bootstrap.php fallback"

This reverts commit 4abd6d61a9.

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:
Franz Liedke 2019-07-14 22:22:06 +02:00
parent 928b360135
commit 10ba2e9464

View File

@ -257,9 +257,9 @@ class Extension implements Arrayable
private function getExtenders(): array private function getExtenders(): array
{ {
$extenderFile = "{$this->path}/extend.php"; $extenderFile = $this->getExtenderFile();
if (! file_exists($extenderFile)) { if (! $extenderFile) {
return []; 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. * Tests whether the extension has assets.
* *