Closed silverstripe-issues closed 11 years ago
comment by: @chillu (ischommer) created at: 2013-03-20
Work in progress: https://github.com/chillu/sapphire/tree/experiments/config-statics
comment by: @chillu (ischommer) created at: 2013-03-21
TODO
Note: Moved class-based setings into #1678 instead
comment by: @tractorcow (tractorcow) created at: 2013-03-25
Can you give me a run down on why statics now must be all private? I believe (if I understand things correctly) that statics are deprecated for configuration. You mention that this is to throw an error. Is this an error that's thrown when the API is used incorrectly?
Thanks in advance for clarifying.
comment by: @tractorcow (tractorcow) created at: 2013-03-25
Also,
Fatal error: Access level to ErrorPage::$defaults must be public (as in class Page) in \cms\code\model\ErrorPage.php on line 292
This is what prompted me to ask this, thanks!
comment by: @tractorcow (tractorcow) created at: 2013-03-25
I think, after actually reading all the related pull request / comments I understand after all. I'll just fix my obsolete code and retreat here. :)
comment by: @tractorcow (tractorcow) created at: 2013-03-25
Just in any case someone else has the same issues I have, the only thing one must do to access any of these configuration variables is to replace this code:
$allowedImageExtensions = File::$app_categories['image'];
With code that looks like the below:
$allowedImageExtensions = File::config()->app_categories['image'];
I now see the value in privatisation here, as it forces me to use the correct api, rather than the lazy way. :)
comment by: @chillu (ischommer) created at: 2013-03-25
Its all detailed in http://doc.silverstripe.org/framework/en/3.1/changelogs/3.1.0#static-configuration-properties-are-now-immutable-you-must-use-config-api BTW. Let me know if those docs are comprehensible, its going to be an important part of the upgrade experience.
Grepped public variables and looks like most of the variables have been updated and deprecations have been added.
created by: @chillu (ischommer) assigned to: @chillu (ischommer) created at: 2013-03-12 original ticket: http://open.silverstripe.org/ticket/8317
See https://github.com/silverstripe/sapphire/pull/1244