Skip to content

Instantly share code, notes, and snippets.

@totten
totten / 1-current.txt
Created August 21, 2014 22:59
Pseudocode for demo rebuilds
foreach $demosite
mark $demosite offline
civibuild destroy $demosite
civibuild create $demosite
mark $demosite online
@totten
totten / gist:5518406
Created May 4, 2013 19:05
Compare performance of checking for existence 10,000 times using (a) function_exists or (b) a data structure cached in DB
<?php
civicrm_initialize();
$a = microtime(TRUE);
function_exists('abc');
$b = microtime(TRUE);
@totten
totten / LoggerInterface.php
Created November 24, 2012 19:45 — forked from Seldaek/LoggerInterface.php
LoggerInterface PSR Proposal
<?php
namespace PSR\Log;
/**
* Describes a logger instance
*
* The $message MUST be a string.
* The $message MAY contain variable expressions like "%var%" which reference $data['var'].
* The "%var%" notation MUST NOT reference values of nested arrays (eg no "%parent.child%" notation).
@totten
totten / LoggerInterface.php
Created November 20, 2012 19:59 — forked from Seldaek/LoggerInterface.php
LoggerInterface PSR Proposal (with fluent options)
<?php
namespace PSR\Log;
/**
* Describes a logger instance
*
* The $message MUST be a string.
* The $message MAY contain variable expressions like "%var%" which reference $data.
* The $message SHOULD NOT include runtime data using plain string concatenation.