mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f233d00072
commit
cca0d327e7
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user