Skip to content

Instantly share code, notes, and snippets.

View e2thex's full-sized avatar

Erik Summerfield e2thex

View GitHub Profile
@e2thex
e2thex / gist:3056240
Created July 5, 2012 20:27
web test not working
//class SPSDrupalVariableControllerUnitTest extends DrupalUnitTestCase {
class SPSDrupalVariableControllerUnitTest extends DrupalWebTestCase {
static function getInfo() {
return array(
'name' => 'SPS DrupalVariableController Unit Tests',
'description' => 'Test the public interface to the DrupalVariableController object',
'group' => 'SPS',
);
}
/**
@e2thex
e2thex / classMap.asciio
Created June 28, 2012 13:08
Prposal for plugin hooks for sps module
<?php
namespace Drupal\sps;
interface OverrideInterface {
/**
* construct an array of override arrays
*
* @return an array of override arrays
*/
public function getOverrides();
}
@e2thex
e2thex / gist:2790471
Created May 25, 2012 20:49
ESI module flow
.------------------------.
| Page Call |
'------------------------'
|
v ____________________________
.---------. \ \
/ Call to \ \ ESI module ask plugin to \
( ESI PATH? )--------->) build content )
\ / / /
@e2thex
e2thex / gist:2711570
Created May 16, 2012 15:56
What PHP fun fact make the use of $last here horribly wrong?
<?php
$output = '<div id="breadcrumb" class="clearfix"><ul class="breadcrumb">';
$switch = array('odd' => 'even', 'even' => 'odd');
$zebra = 'even';
$last = count($variables['breadcrumb']) - 1;
foreach ($variables['breadcrumb'] as $key => $item) {
$zebra = $switch[$zebra];
$attributes['class'] = array('depth-' . ($key + 1), $zebra);