BUGFIX Don't try to fetch contents from non-existent debug.log files in Debug::log() (merged from branches/2.3-nzct)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82059 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-16 23:48:41 +00:00
parent f233d00072
commit cca0d327e7

View File

@ -174,7 +174,7 @@ class Debug {
static function log($message) { static function log($message) {
$file = dirname(__FILE__).'/../../debug.log'; $file = dirname(__FILE__).'/../../debug.log';
$now = date('r'); $now = date('r');
$oldcontent = file_get_contents($file); $oldcontent = (file_exists($file)) ? file_get_contents($file) : '';
$content = $oldcontent . "\n\n== $now ==\n$message\n"; $content = $oldcontent . "\n\n== $now ==\n$message\n";
file_put_contents($file, $content); file_put_contents($file, $content);
} }