Skip to content

Instantly share code, notes, and snippets.

@hidenorigoto
hidenorigoto / IntlDateFormatter.php
Last active November 20, 2017 01:32
INTL(ICU)のIntlDateFormatterを使って和暦、曜日を表示
<?php
$date = new \DateTime();
// 平成◯◯年
$dateFormatter = \IntlDateFormatter::create(
"ja_JP@calendar=japanese",
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
"Asia/Tokyo",
\IntlDateFormatter::TRADITIONAL,
@hidenorigoto
hidenorigoto / php52
Last active October 1, 2015 09:58 — forked from tanakahisateru/gist:1344162
PHP5.5 PHP5.4 configure for my MacBook Air (MySQL with homebrew / other with macports)
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin/php54 \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@hidenorigoto
hidenorigoto / deps.example
Created December 31, 2011 03:12
Symfony2 deps additional
; sf2 standard deps here
; ;
;
; utilities for my web development
;
; some utilities
[XnniUtilBundle]
git=git://github.com/hidenorigoto/XnniUtilBundle.git
@hidenorigoto
hidenorigoto / nginx.conf.example
Created December 25, 2011 15:25
nginx Symfony2 example (subdirectory) WIP
server {
listen 80;
root /var/www/sitename;
server_name sitename;
index index.html index.php app.php;
if ($uri ~ \.(css|png|js|gif|jpg)$) {
break;
}
@hidenorigoto
hidenorigoto / ContainerExtension.php
Created October 24, 2011 15:42
Symfony\Bundle\TwigBundle\Extension\ContainerExtension example
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@hidenorigoto
hidenorigoto / TargetTest.php
Created October 15, 2011 17:30
StageHand_TestRunner
<?php
require_once __DIR__ . '/TestCaseBase.php';
class TargetTest extends TestCaseBase
{
public function testAlwaysTrue()
{
$this->assertTrue(true);
}
}
# language: ja
フィーチャ: 初めてのフィーチャ
PHPerとして
PHP 5.3.2以降を使いたい
なぜならSymfony2が動作する必須要件だからだ
シナリオ: PHPのバージョンを調べる
もし PHPのバージョン番号を取得する
ならば 取得したバージョン番号が "5.3.2" 以上であること
@hidenorigoto
hidenorigoto / some.php
Created October 12, 2011 01:30
Initialize Phake for enabling "verify"
<?php
require_once 'Phake.php';
\Phake::setClient(\Phake::CLIENT_PHPUNIT);
@hidenorigoto
hidenorigoto / CHANGES.md
Created September 25, 2011 10:10
Behat/Behat CHANGES (Japanese)
@hidenorigoto
hidenorigoto / bootstrap.php
Created September 23, 2011 17:14
bootstrap for Doctrine2 (2.1)
<?php
require __DIR__ . '/vendor/doctrine/lib/Doctrine/ORM/Tools/Setup.php';
$lib = __DIR__ . '/vendor/doctrine';
Doctrine\ORM\Tools\Setup::registerAutoloadGit($lib);
$config = Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(array(__DIR__ . '/Entity/Project/Entity'), true);
$loader = new Doctrine\Common\ClassLoader("Project\Entity", __DIR__ . '/Entity');
$loader->register();
$connectionOptions = array(