diff options
author | Filipp Lepalaan <filipp@mac.com> | 2011-08-01 15:39:42 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2011-08-01 15:39:42 +0300 |
commit | b09adf07febd1e3cc14449434532451c98aad2c7 (patch) | |
tree | 51e5a60a7960b1f8c7f65bd115f9e27670064edd /MainApp.php | |
parent | 84b13d3d2642ad79369b33772c31c3e51d46d36f (diff) | |
download | main-b09adf07febd1e3cc14449434532451c98aad2c7.tar.gz main-b09adf07febd1e3cc14449434532451c98aad2c7.tar.bz2 main-b09adf07febd1e3cc14449434532451c98aad2c7.zip |
some fixes
Diffstat (limited to 'MainApp.php')
-rw-r--r-- | MainApp.php | 9 |
1 files changed, 8 insertions, 1 deletions
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'); |