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
<?php | |
$stream1 = fopen('php://output', 'wb'); | |
stream_filter_append($stream1, 'string.rot13'); | |
fwrite($stream1, "hoge\n"); | |
fwrite(STDOUT, "hoge\n"); | |
echo "hoge\n"; | |
echo "-\n"; | |
$stream2 = fopen('php://stdout', 'wb'); |
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 | |
/* vim: set expandtab tabstop=4 shiftwidth=4: */ | |
/** | |
* PHP version 5.3 | |
* | |
* Copyright (c) 2012 GOTO Hidenori <hidenorigoto@gmail.com>, | |
* 2012 KUBO Atsuhiro <kubo@iteman.jp>, | |
* All rights reserved. | |
* |
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 | |
$date = new \DateTime(); | |
// 平成◯◯年 | |
$dateFormatter = \IntlDateFormatter::create( | |
"ja_JP@calendar=japanese", | |
\IntlDateFormatter::FULL, | |
\IntlDateFormatter::FULL, | |
"Asia/Tokyo", | |
\IntlDateFormatter::TRADITIONAL, |
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
# Change Java Runtime: | |
sudo update-alternatives --config java | |
# Delete Open-JDK | |
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* | |
# Change fonts - remove hinting: | |
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font | |
# Change RubyMine AntiAliasing first: |
Haydnをコレクション演算部分に適用する例
利用するコード: https://github.com/phpmentors-jp/workflower/blob/master/src/Workflow/Workflow.php#L411
- ここではコレクションの要素を変換しつつ、変換結果を見てフィルタし、最終オブジェクトへ変換する。HaydnではPHPの配列/連想配列に入っているものなら何でも扱えるので、このようにオブジェクトのコレクションごと変換・フィルタといった操作として記述できる。
更新: | 2023-12-08 |
---|---|
作者: | @voluntas |
バージョン: | 2023.2 |
URL: | https://voluntas.github.io/ |
タイポなどは Twitter の @voluntas までお願いします。