Skip to content

Instantly share code, notes, and snippets.

@brtriver
brtriver / compile.php
Created January 21, 2012 17:01
Twig.git to twig.phar
<?php
$phar = new Phar('twig.phar', 0, 'twig.phar');
$phar->buildFromDirectory(__DIR__ . '/Twig.git/lib');
$phar->compressFiles(Phar::GZ);
$phar->setDefaultStub();
<?php
/*
こんなイメージ
(例) 1,1 と 1,2 に爆弾がある
x:1 x:2 x:3 x:4
+-----+-----+-----+-----+
y:1| x | | | |
+-----+-----+-----+-----+
@brtriver
brtriver / gist:978383
Created May 18, 2011 11:12 — forked from heavenshell/gist:978358
Silex error
<?php
require_once 'silex.phar';
$app = new Silex\Application();
$app->get('/', function () {
return 'index';
});
$app->get('/hello/{name}', function ($name) {
<?php
/**
* MongoSessionStrage manages session storage via MongoDB
*
* This class stores the session data in via MongoDB and with an id issued in a
* signed cookie. Useful when you don't want to store the session.
*
* @package PHP
* @subpackage session
* @author Masao Maeda <brt.river@gmail.com>