aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-24 17:54:45 -0700
committerredmatrix <git@macgirvin.com>2016-05-24 17:54:45 -0700
commit516c43ba154dc43ec0ef6135fb0a9732d0185a6f (patch)
tree9e8fcfbd22f6ad8013fd48ec60090be7ccf73d11 /include/text.php
parent84ba6393ad32406a9875044aef2d031c7d0d7a46 (diff)
downloadvolse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.tar.gz
volse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.tar.bz2
volse-hubzilla-516c43ba154dc43ec0ef6135fb0a9732d0185a6f.zip
more work associated with DBA and index.php shuffle
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/include/text.php b/include/text.php
index 21692e74f..caaef664f 100644
--- a/include/text.php
+++ b/include/text.php
@@ -567,21 +567,25 @@ function attribute_contains($attr, $s) {
*/
function logger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) {
- // turn off logger in install mode
- global $a;
- global $db;
-
- if((App::$module == 'install') || (! (DBA::$dba && DBA::$dba->connected)))
- return;
- $debugging = get_config('system', 'debugging');
- $loglevel = intval(get_config('system', 'loglevel'));
- $logfile = get_config('system', 'logfile');
+ if(App::$module == 'setup' && is_writable('install.log')) {
+ $debugging = true;
+ $logfile = 'install.log';
+ $loglevel = LOGGER_ALL;
+ }
+ else {
+ $debugging = get_config('system', 'debugging');
+ $loglevel = intval(get_config('system', 'loglevel'));
+ $logfile = get_config('system', 'logfile');
+ }
if((! $debugging) || (! $logfile) || ($level > $loglevel))
return;
$where = '';
+
+ // We require > 5.4 but leave the version check so that install issues (including version) can be logged
+
if(version_compare(PHP_VERSION, '5.4.0') >= 0) {
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
$where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': ';
@@ -590,7 +594,8 @@ function logger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) {
$s = datetime_convert() . ':' . log_priority_str($priority) . ':' . session_id() . ':' . $where . $msg . PHP_EOL;
$pluginfo = array('filename' => $logfile, 'loglevel' => $level, 'message' => $s,'priority' => $priority, 'logged' => false);
- call_hooks('logger',$pluginfo);
+ if(! (App::$module == 'setup'))
+ call_hooks('logger',$pluginfo);
if(! $pluginfo['logged'])
@file_put_contents($pluginfo['filename'], $pluginfo['message'], FILE_APPEND);