-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various deprecations and a few features #11365
Merged
emteknetnz
merged 4 commits into
silverstripe:5
from
creative-commoners:pulls/5/cms5-for-sakesymfony
Sep 13, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ class DevelopmentAdmin extends Controller implements PermissionProvider | |
* ] | ||
* | ||
* @var array | ||
* @deprecated 5.4.0 Will be replaced with "controllers" and "commands" configuration properties | ||
*/ | ||
private static $registered_controllers = []; | ||
|
||
|
@@ -82,7 +83,7 @@ protected function init() | |
if (static::config()->get('deny_non_cli') && !Director::is_cli()) { | ||
return $this->httpError(404); | ||
} | ||
|
||
if (!$this->canViewAll() && empty($this->getLinks())) { | ||
Security::permissionFailure($this); | ||
return; | ||
|
@@ -201,8 +202,12 @@ protected function getLinks(): array | |
return $links; | ||
} | ||
|
||
/** | ||
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it | ||
*/ | ||
protected function getRegisteredController($baseUrlPart) | ||
{ | ||
Deprecation::notice('5.4.0', 'Will be removed without equivalent functionality to replace it'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to wrap in withNotReplacement() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? It's not called from anywhere? |
||
$reg = Config::inst()->get(static::class, 'registered_controllers'); | ||
|
||
if (isset($reg[$baseUrlPart])) { | ||
|
@@ -223,9 +228,18 @@ protected function getRegisteredController($baseUrlPart) | |
* DataObject classes | ||
* Should match the $url_handlers rule: | ||
* 'build/defaults' => 'buildDefaults', | ||
* | ||
* @deprecated 5.4.0 Will be replaced with SilverStripe\Dev\Commands\DbDefaults | ||
*/ | ||
public function buildDefaults() | ||
{ | ||
Deprecation::withNoReplacement(function () { | ||
Deprecation::notice( | ||
'5.4.0', | ||
'Will be replaced with SilverStripe\Dev\Command\DbDefaults' | ||
); | ||
}); | ||
|
||
$da = DatabaseAdmin::create(); | ||
|
||
$renderer = null; | ||
|
@@ -247,9 +261,18 @@ public function buildDefaults() | |
/** | ||
* Generate a secure token which can be used as a crypto key. | ||
* Returns the token and suggests PHP configuration to set it. | ||
* | ||
* @deprecated 5.4.0 Will be replaced with SilverStripe\Dev\Commands\GenerateSecureToken | ||
*/ | ||
public function generatesecuretoken() | ||
{ | ||
Deprecation::withNoReplacement(function () { | ||
Deprecation::notice( | ||
'5.4.0', | ||
'Will be replaced with SilverStripe\Dev\Command\GenerateSecureToken' | ||
); | ||
}); | ||
|
||
$generator = Injector::inst()->create('SilverStripe\\Security\\RandomGenerator'); | ||
$token = $generator->randomToken('sha1'); | ||
$body = <<<TXT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to wrap in withNoReplacement as there's no replacement in CMS 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We don't use this anywhere?