From b09adf07febd1e3cc14449434532451c98aad2c7 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 1 Aug 2011 15:39:42 +0300 Subject: some fixes --- MainApp.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'MainApp.php') diff --git a/MainApp.php b/MainApp.php index 0e79f96..0cf0442 100644 --- a/MainApp.php +++ b/MainApp.php @@ -11,6 +11,7 @@ * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ + class MainApp { //// @@ -172,7 +173,13 @@ class MainApp $file = self::conf('app.error_log'); if (!file_exists($file)) { - exit('Log file does not exist'); + // try to guess log file location + $basedir = dirname( dirname( $_SERVER['SCRIPT_FILENAME'] )); + $file = sprintf( '%s/data/logs/error.log', $basedir ); + } + + if( !file_exists( $file )) { + exit( 'Log file does not exist' ); } $fh = fopen($file, 'a+') or die('Failed to open log file'); -- cgit v1.2.3