Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
$FunctionList = array();
$FunctionList['locale_list'] = array(
'name' => 'locale_list',
public function value(&$value, $method, $name)
{
// get the params
$params = func_get_args();
array_shift($params); // $value
array_shift($params); // $method
array_shift($params); // $name
// set up the field name and data
$field = 'field';
@pmjones
pmjones / gist:4199388
Created December 4, 2012 00:33
Aura setPdo() diff
diff --git a/src/Aura/Sql/Connection/AbstractConnection.php b/src/Aura/Sql/Connection/AbstractConnection.php
index 467498c..2dca2a5 100644
--- a/src/Aura/Sql/Connection/AbstractConnection.php
+++ b/src/Aura/Sql/Connection/AbstractConnection.php
@@ -72,6 +72,8 @@ abstract class AbstractConnection
*/
protected $password;
+ protected $profiler;
+
@pmjones
pmjones / gist:5877934
Last active December 19, 2015 01:39
Brain dead variation.

PSR-T: Transformation Of Logical Paths To File System Paths

This document describes an algorithm to transform a logical resource path to a file system path. Among other things, the algorithm allows transformation of class paths and other logical resource paths to file paths.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

@pmjones
pmjones / gist:5880322
Created June 27, 2013 20:54
transform rules comparison
Simensen Rules
--------------
1 MUST immediately return the _file system path base_ if the _source_ is equal
to the _logical path base_.
2 MUST return `false` if the _logical path base_ is not valid.
3 MUST append a directory to the _file system path base_, and
@pmjones
pmjones / gist:7129733
Last active December 26, 2015 09:29
Simplified rewrite of PSR-4, with a nod to Beau Simensen.

Autoloading Standard

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory

  • The term "class" refers to classes, interfaces, traits, and other similar structures.
Some (but not all) rules for submitting Aura code:
- PSR-1 and 2
- !-operator is followed by space: `! isset()` vs `!isset()`
- under_scores for vars and props, not camelCase
- 100% test coverage of your added code
- No `new` keyword except in factories/builders
- Although `new` is ok with core PHP classes, and exceptions
- Use existing vocabulary: fetch, set, get, load, prep, init, etc
- Use __invoke() for "main" object method
<?php
namespace foo\bar;
use Aura\Marshal\Entity\MagicArrayAccessTrait;
use ArrayAccess;
class ArrayAccessEntityExample impelements ArrayAccess
{
use MagicArrayAccessTrait;
<?php
namespace foo\bar;
use Aura\Marshal\Entity\MagicPropertyTrait;
class PropertyEntityExample impelements ArrayAccess
{
use MagicPropertyTrait;
protected $baz;
==================================================
Install Silex 1.1.2 and remove tests
==================================================
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing psr/log (1.0.0)
Loading from cache
- Installing symfony/routing (v2.4.0)