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 committed by Daniël Klabbers
parent 627724839d
commit 64b53fb0ac

View File

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