Request::hasSession()の現在の実装の意図
- (意図A)クライアントから送られてきた(本来の意味の)リクエストがセッション有効状態か(=Cookieを持っているか)を調べる
- (意図B)単にセッションオブジェクトがあるかないかという判定
- (意図C)セッションオブジェクトがあり、開始済みかどうか
現在のhasSession()メソッドは、意図Aの実装であると考えられる。ただし、以下に挙げる呼び出し箇所では、意図Bなどが混在して用いられていると思われる。
Request::hasSession()の使われ方
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
package main | |
import( | |
"io"; | |
"fmt"; | |
"bytes"; | |
"template"; | |
"os"; | |
"strings"; | |
"strconv"; | |
"http"; |
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 | |
/** | |
* xnTwitterStream.class.php | |
* Twitter Streaming APIでのデータの取得用クラス | |
**/ | |
class xnTwitterStrream implements Iterator | |
{ | |
const READ_NULL_REPEAT_MAX = 30; | |
/** | |
* @var $dispather sfEventDispatcher |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
</head> | |
<body> | |
<?php echo $this->esi->handle($this, 'http://ubook/~goto/symfony-sandbox/web/HelloBundle%3ACommon%3Aheader/none.html', '', true)->getContent() ?> | |
Hello goto! |
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 | |
// Sensio/HelloBundle/DependencyInjection | |
namespace Sensio\HelloBundle\DependencyInjection; | |
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | |
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\Config\FileLocator; |
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
# 多分一度cloneし直したほうが早いので、作業したファイルをどこかにバックアップ | |
# その後 git://github.com/hidenorigoto/sfjp-doc-main.git を clone | |
git clone git://github.com/hidenorigoto/sfjp-doc-main.git | |
# sfjp-doc-mainディレクトリに移動してブランチを作成 | |
git checkout -b translate-awos-228 | |
# バックアップしたファイルを追加して、add → commit | |
git add . | |
git commit |
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
:+1: | |
:-1: | |
:airplane: | |
:art: | |
:bear: | |
:beer: | |
:bike: | |
:bomb: | |
:book: | |
:bulb: |
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 | |
// for Symfony2 tests | |
$world->getContainer = function() use ($world) { | |
return $world->getSession()->getDriver()->getClient()->getKernel()->getContainer(); | |
}; | |
$world->getEm = function() use ($world) { | |
return $world->getContainer()->get('doctrine')->getEntityManager(); | |
}; |
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
$qb = $em->createQueryBuilder(); | |
$qb->select('p') | |
->from('AcmeTestBundle:Post', 'p') | |
->where('p.order_date < :targetDate') | |
->setParameters(array( | |
'targetDate' => new \DateTime('2011-08-07'), | |
)); | |
$q = $qb->getQuery(); |
OlderNewer