0
シェル出力とエラーをCakePHP 2.xのファイルにリダイレクトする方法を示す記事が見つかりました。どのようにCakePHP 3.xを使用することができますか?ここで CakePHP 3シェルの出力とエラーを集める
は、私は、CakePHP 2.xのpublic function __construct($stdout = null, $stderr = null, $stdin = null) {
// This will cause all Shell outputs, eg. from $this->out(), to be written to
// TMP.'shell.out'
$stdout = new ConsoleOutput('file://'.TMP.'shell.out');
// You can do the same for stderr too if you wish
// $stderr = new ConsoleOutput('file://'.TMP.'shell.err');
parent::__construct($stdout, $stderr, $stdin);
}
見つかりコードスニペットですが、私は、CakePHP 3.xので
PHP Fatal error: Class 'App\Shell\ConsoleOutput' not found
がConsoleOutputです、次のエラーを取得していますし、もしそうなら、何があります名前空間?
はしかし、出力をファイルにリダイレクトしているように見える...任意のアイデアなぜですか? –
リンク:https://stackoverflow.com/a/11606218/5737771 –
ええと、私はそれを試みました、うまくいきませんでした...私は新しい質問を投稿しました... https://stackoverflow.com/questions/45620364/cakephp -3-redirect-console出力ファイル –