Skip to content

Instantly share code, notes, and snippets.

@alganet
alganet / rd.php
Created September 5, 2012 01:47
Respect\Database Thoughts
<?php
// Respect\Database is an easy API for any database with dead simple drivers
use Respect\Database\Data;
$data = new Data(array(
'p001' => new PDO(/*...*/),
'tweets' => new Mongo(/*...*/),
'timelines' => new Predis\Client(/*...*/),
@thiagophx
thiagophx / example.php
Created October 9, 2011 00:42
ServiceLocator in PHP
<?php
abstract class ServiceLocator
{
protected static $locator;
public static function load(ServiceLocator $locator)
{
self::$locator = $locator;
}