This file contains hidden or 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 | |
/** | |
* 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 <[email protected]> |
This file contains hidden or 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 | |
require_once 'silex.phar'; | |
$app = new Silex\Application(); | |
$app->get('/', function () { | |
return 'index'; | |
}); | |
$app->get('/hello/{name}', function ($name) { |
This file contains hidden or 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 | |
/* | |
こんなイメージ | |
(例) 1,1 と 1,2 に爆弾がある | |
x:1 x:2 x:3 x:4 | |
+-----+-----+-----+-----+ | |
y:1| x | | | | | |
+-----+-----+-----+-----+ |
This file contains hidden or 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 | |
$phar = new Phar('twig.phar', 0, 'twig.phar'); | |
$phar->buildFromDirectory(__DIR__ . '/Twig.git/lib'); | |
$phar->compressFiles(Phar::GZ); | |
$phar->setDefaultStub(); |
This file contains hidden or 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 | |
namespace Silex\Provider; | |
use Silex\Application; | |
use Silex\SilexEvents; | |
use Silex\ControllerProviderInterface; | |
use Silex\ControllerCollection; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
This file contains hidden or 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 | |
require __DIR__ .'/silex.phar'; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\Cookie; | |
$app = new Silex\Application(); | |
$app['debug'] = true; |
This file contains hidden or 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 | |
date_default_timezone_set('Asia/Tokyo'); | |
if (date('n', strtotime('this month')) === date('n', strtotime('last month'))) { | |
echo "never call"; | |
} | |
// last month は前月の"同一日"を返そうとするので、 | |
// 2月30日 -> 3月1日 のように解釈されてしまう。 | |
// 前月の月を知りたい場合は 以下のようにfirst day of をつけないと先月が何月かを正確に取得できない! |
This file contains hidden or 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
{ | |
"require": { | |
"symfony/routing": "2.1.*", | |
"symfony/http-foundation": "2.1.*", | |
"symfony/config": "2.1.*", | |
"symfony/yaml": "2.1.*", | |
"pimple/pimple": "dev-master" | |
} | |
} |
This file contains hidden or 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
server { | |
listen 80; | |
server_name php54.vm.localhost; | |
access_log /var/log/nginx/vm.localhost.access.log; | |
error_log /var/log/nginx/vm.localhost.error.log; | |
location / { | |
root /var/www/localhost/web; | |
index index.html index.htm; |
This file contains hidden or 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
# More info at https://github.com/guard/guard#readme | |
guard 'shell' do | |
watch(/src\/(.*).php/) {|m| `php hamcrester.php #{m[0]}` } | |
end |
OlderNewer