Saving data to a site context from the front-end is a common requirement in contrib development, and a recurring question is support requests and on IRC. I propose that we add a sub-module to our existing example module (and the same in provision) that is stripped down to just the bare essentials for passing passing and retrieving such data.

Patches forthcoming...

Comments

ergonlogic’s picture

Patches attached.

anarcat’s picture

+++ b/example/site_data/site_data.drush.incundefined
@@ -0,0 +1,37 @@
+function drush_site_data_post_provision_install() {
+  drush_log('[SITE_DATA] d()->site_data: ' . d()->site_data, 'warning');
+}

this seems a little unusual as a log format, but otherwise, this seems like a good idea.

anarcat’s picture

Status: Active » Reviewed & tested by the community
ergonlogic’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in ca5083d and caae02e.

That drush_log entry is also setting a warning to bring attention to itself. I think for contrib, it's not necessarily a bad idea that they identify right in the log like that. But to avoid unnecessary bike-shedding, I'll gladly defer to whatever format anyone feels strongly enough to go chance it too :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.