CakePHP 1.2 のシェルで標準入力を取得
Shell クラスから見て $this->Dispatch->stdin に標準入力のハンドラがある。
<?php class FooShell extends Shell { function main() { $stdin = $this->Dispatch->stdin; while (!feof($stdin)) { $buffer = fgets($stdin); // 1行取得 echo $buffer; // 何らかの処理 } } }