Здравствуйте.
Greets.
I'm writting module that uses Flex in admin page. I need to store big amount of settings and rules (one assoc array) for Flex swf object to initialize. So these data NOT needed anywhere except only ONE page. I've read official docs on creating module, here at drupal.org and but not found answer on my simple question.
* If use variable_get/set - the data will be loaded EVERY TIME drupal is started. But these data will be needed only once in 2000 page loads. Not very logical)
* Create separate table for only one row with data - inappropriate.
So I wanted to know the right "drupal way" to store big amounts of module data hash that rarely needed.
Could you please help me with this question?
Thanks.
Comments
good question
Yeah, sticking big stuff in variables where it is needed rarely would be wrong.
I understand why you don't want to put it in the DB either, but it's probably the way. There's a good number of drupal modules that already make their own tables for stuff I'd call trivial - but it's probably the most straightforward way for you
I avoid making db tables if I can find an excuse to put it in variables, but - it's not totally wrong.
Assuming of course that the hash is somewhat volatile ... then my advice would be make your own db table.
Note that if you use the db schema approach correctly, it will even serialize & deserialize data for you when you use db_write_record etc
.dan. is the New Zealand Drupal Developer working on Government Web Standards
In this situation, the
In this situation, the database is the better way to go.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
solved
solved this by creating a module that I use for my projects now. You can try it too.