Skip to content

Instantly share code, notes, and snippets.

View devosc's full-sized avatar

devosc

View GitHub Profile
@jm42
jm42 / app_config.php
Created October 30, 2014 04:31
MVC Framework Test
<?php
$container['db.config'] = array(
'file' => __DIR__ . '/../tmp/mvc.db',
'init' => function(PDO $pdo) {
$pdo->exec('CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR(255))');
$pdo->exec('INSERT INTO user (id, name) VALUES (1, "John Doe")');
$pdo->exec('INSERT INTO user (id, name) VALUES (2, "Jane Doe")');
},
);
<?php
// iterator impl:
class MapIterator extends IteratorIterator {
private $f;
public function __construct($f, $inner) {
parent::__construct($inner);
$this->f = $f;