0
を提出する私は、CakePHP 3のファイルにCakePHPの3リダイレクトConsoleOutputは
をシェルからのコンソール出力をリダイレクトしようとしている私は、CakePHP 2のためのいくつかのスニペットを発見した、しかし、彼らが作業していないようです...ここで
は、私がこれまでに...
public $rootLogsDirectory = ROOT . DS . 'tmp' . DS . 'logs';
public $outputName;
public function __construct($stdout = null, $stderr = null, $stdin = null) {
if(!is_dir($this->rootLogsDirectory)) {
mkdir($this->rootLogsDirectory);
}
$this->outputName = tempnam($this->rootLogsDirectory, 'cronjobs');
$stdout = new ConsoleOutput('file://' . $this->outputName . '.out');
$stderr = new ConsoleOutput('file://' . $this->outputName . '.err');
$ioNew = new ConsoleIo($stdout, $stderr);
$ioNew->out('test');
parent::__construct($ioNew);
}
しかし、$this->out('hello world')
がファイルに書き込まれていないしているコードは、私が間違っているuse文を持っていた...