Skip to content

Commit

Permalink
API Deprecate references to installation tool (#11275)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jun 12, 2024
1 parent be0eab2 commit 049e546
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Core/BaseKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use SilverStripe\View\ThemeManifest;
use SilverStripe\View\ThemeResourceLoader;
use Exception;
use SilverStripe\Dev\Deprecation;

/**
* Simple Kernel container
Expand Down Expand Up @@ -308,10 +309,13 @@ protected function detectLegacyEnvironment()
* If missing configuration, redirect to install.php if it exists.
* Otherwise show a server error to the user.
*
* @deprecated 5.3.0 Will be removed without equivalent functionality
*
* @param string $msg Optional message to show to the user on an installed project (install.php missing).
*/
protected function redirectToInstaller($msg = '')
{
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality');
// Error if installer not available
if (!file_exists(Director::publicFolder() . '/install.php')) {
throw new HTTPResponse_Exception(
Expand Down
3 changes: 2 additions & 1 deletion src/Core/CoreKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\ORM\DB;
use Exception;
use LogicException;
use SilverStripe\Dev\Deprecation;

/**
* Simple Kernel container
Expand Down Expand Up @@ -52,7 +53,7 @@ protected function validateDatabase()
$msg = 'Silverstripe Framework requires a "database" key in DB::getConfig(). ' .
'Did you forget to set SS_DATABASE_NAME or SS_DATABASE_CHOOSE_NAME in your environment?';
$this->detectLegacyEnvironment();
$this->redirectToInstaller($msg);
Deprecation::withNoReplacement(fn() => $this->redirectToInstaller($msg));
}
}

Expand Down

0 comments on commit 049e546

Please sign in to comment.