Trying to implement oneboxes (see #1341556: Add Support for Oneboxes)...

I need Google Appliance to implement a static response cache for easy access to the search results outside of the google_appliance_search_view context.

Patch attached.

Comments

mpgeek’s picture

Status: Needs review » Reviewed & tested by the community
mpgeek’s picture

Assigned: Unassigned » mpgeek
iamEAP’s picture

Assigned: mpgeek » Unassigned
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.57 KB

I was basing my code off of the 6.x version of this module (which itself was based on an old version of the ApacheSolr module). I just discovered drupal_static(), which was introduced in D7.

No use in doing our own special thing.

Patch attached. It looks like a significant change, but all I'm doing is wrapping the existing code with...

  $results = &drupal_static(__FUNCTION__);
  if (!isset($results)) {
    // Existing code...
  }

  return $results;

Other modules could get at the data by calling &drupal_static('google_appliance_parse_device_response_xml');

mpgeek’s picture

Assigned: Unassigned » mpgeek
Status: Needs review » Reviewed & tested by the community

Committed to dev: http://drupalcode.org/project/google_appliance.git/commit/695c260. Huzzah for D7 design patterns in D7 modules.

mpgeek’s picture

Assigned: mpgeek » Unassigned

Implemented. See 7.x-1.7.

mpgeek’s picture

Status: Reviewed & tested by the community » Closed (fixed)