Timeline for Best Way to Handle Variables Per Environment
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 4, 2017 at 13:05 | comment | added | xpersonas | Thanks for the additional info @Berdir. That helps. And I was just referencing the State API page itself at drupal.org/docs/8/api/state-api/overview. | |
Aug 4, 2017 at 12:00 | comment | added | avpaderno♦ | The comment before this was for @xpersonas. | |
Aug 3, 2017 at 19:31 | comment | added | Berdir | Note sure where you read about state and losing data, data stored in state is not lost, a lot of quite critical information for Drupal to work is stored in there. But settings and alternatively config overrides through settings.php is definitely much better suited for this. State API is mostly for things that code manages internally, for example Drupal uses it to store the last time cron was executed. Or whether the maintenance mode is enabled or not (there it makes sense because it is something that is temporarily enabled and then disabled again, not something you control per environment | |
Aug 3, 2017 at 9:10 | history | edited | kenorb | CC BY-SA 3.0 |
added 1 character in body
|
Aug 3, 2017 at 9:04 | history | edited | kenorb | CC BY-SA 3.0 |
Added another example.
|
Aug 3, 2017 at 1:50 | comment | added | xpersonas | I actually looked into the State API a bit before posting. I read the part that stated: "So, use State API to store transient information, that is okay to lose after a reset." I was in a bit of a debate if this would qualify or not based on that. Honestly, I'm still a little unsure. | |
Aug 3, 2017 at 1:47 | vote | accept | xpersonas | ||
Aug 2, 2017 at 23:24 | history | edited | kenorb | CC BY-SA 3.0 |
Corrects as per comment.
|
Aug 2, 2017 at 23:04 | comment | added | Clive♦ |
Oh and you'll have to initialise $baseUrl in the constructor, default values for properties have to be constant
|
|
Aug 2, 2017 at 22:59 | comment | added | Clive♦ | Also see the State API which was built for similar use cases | |
Aug 2, 2017 at 22:55 | history | answered | kenorb | CC BY-SA 3.0 |