Skip to content

Instantly share code, notes, and snippets.

View aaronschachter's full-sized avatar

Aaron Schachter aaronschachter

  • San Francisco, CA
View GitHub Profile
@aaronschachter
aaronschachter / gist:7643201
Created November 25, 2013 15:38
dosomething_campaign_entity_property_info stub
/**
* Implements hook_entity_property_info().
*/
function dosomething_campaign_entity_property_info() {
$info = array();
$properties = &$info['campaign']['properties'];
$properties['id'] = array(
'label' => t("Campaign ID"),
'type' => 'integer',
'description' => t("The unique campaign ID."),
@aaronschachter
aaronschachter / gist:5591594
Created May 16, 2013 13:10
flush_page_cache addition in settings.php
// Wrapper class for extending MemCacheDrupal to support flushing a page's cache.
require_once DRUPAL_ROOT . '/includes/cache.inc';
require_once DRUPAL_ROOT . '/sites/all/modules/memcache/memcache.inc';
class FlushPageCacheMemCacheDrupal extends MemCacheDrupal {
function get($cid) {
// Handle flush page cache request by deleting the cached object and returning FALSE.
if (function_exists('flush_page_cache_requested') && flush_page_cache_requested()) {
return FALSE;
}