Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

woutsanders

💭
I may be slow to respond.
View GitHub Profile
@woutsanders
woutsanders / DoctrineReference.yml
Last active Aug 29, 2015 — forked from mnapoli/reference.yml
Holds common Doctrine relation and field definitions
View DoctrineReference.yml
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@woutsanders
woutsanders / autoloadPSR0.php
Last active Aug 29, 2015 — forked from adriengibrat/l.php
A very quick PSR-0 SPL autoloader function
View autoloadPSR0.php
<?php
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional
spl_autoload_register(function ($class) {
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php';
if (stream_resolve_include_path($file)) {
require $file;
}