Skip to content

Instantly share code, notes, and snippets.

View DarkSmith's full-sized avatar

Smith DarkSmith

  • Paris
View GitHub Profile
@DarkSmith
DarkSmith / zf.sh
Created August 28, 2012 16:11
Zend Framework 2 Command Line shell
#!/usr/bin/php
<?php
$applicationIndex = realpath(getcwd() . '/public/index.php');
if (!empty($applicationIndex)) {
include $applicationIndex;
} else exit('You are not in a valid Zend Framework Application root directory');
@DarkSmith
DarkSmith / gist:3033877
Created July 2, 2012 15:46
access to object with dot notation string
$data = array('parent' => array('child' => 'hello world'));
$filter = new DotNotationFilter($data); // $data is an object or an array
$hello = $filter->get('parent.child'); // eq to $data['parent'][’child'] or $data->parent->child;
$hello == 'hello world';