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:
Franz Liedke 2019-07-14 22:22:06 +02:00
parent 7f1048352d
commit ed97989ca2
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -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.
*