diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 0dcf802a3..8ac484838 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -433,6 +433,13 @@ class Shell extends Object { if (!class_exists('File')) { uses('file'); } + + $lineBreak = "\n"; + if (substr(PHP_OS,0,3) == "WIN") { + $lineBreak = "\r\n"; + } + $data = strtr($contents, array("\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak)); + if ($File = new File($path, true)) { $File->write($contents); $this->out(__("Wrote", true) ." {$path}"); diff --git a/cake/libs/file.php b/cake/libs/file.php index 1803360d5..cbd20499f 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -216,11 +216,6 @@ class File extends Object { return false; } } - $lineBreak = "\n"; - if (substr(PHP_OS,0,3) == "WIN") { - $lineBreak = "\r\n"; - } - $data = strtr($data, array("\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak)); if (fwrite($this->handle, $data) !== false) { $success = true;