This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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")'); | |
}, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// iterator impl: | |
class MapIterator extends IteratorIterator { | |
private $f; | |
public function __construct($f, $inner) { | |
parent::__construct($inner); | |
$this->f = $f; |