From 7b261205829eb08e587609c93ef3a18936bdf182 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 10 Aug 2008 22:52:52 +0000 Subject: [PATCH] (merged from branches/roa. use "svn log -c -g " for detailed commit message) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60259 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/Debug.php | 23 +++++++++++++++++++++++ dev/DebugView.php | 5 +++++ forms/ConfirmedPasswordField.php | 1 + 3 files changed, 29 insertions(+) diff --git a/dev/Debug.php b/dev/Debug.php index 708c55bc6..2107846d0 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -170,6 +170,29 @@ class Debug { } } + /** + * Log to a standard text file output. + * + * @param $message string to output + */ + static function log($message) { + $file = dirname(__FILE__).'/../../debug.log'; + $now = date('r'); + $oldcontent = file_get_contents($file); + $content = $oldcontent . "\n\n== $now ==\n$message\n"; + file_put_contents($file, $content); + } + + private static $warning_pos = 220; + + static function warning($notice) { + echo '
'; + echo '
Warning:
'; + echo '

'.$notice.'

'; + echo '
'; + self::$warning_pos = self::$warning_pos-50; + } + /** * Load error handlers into environment */ diff --git a/dev/DebugView.php b/dev/DebugView.php index 351f24b90..4595e09df 100644 --- a/dev/DebugView.php +++ b/dev/DebugView.php @@ -1,4 +1,9 @@