aboutsummaryrefslogtreecommitdiffstats
path: root/include/common.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.inc.php')
-rw-r--r--include/common.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index e3f4a16c7..8fab02ab2 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -104,6 +104,9 @@ if(isset($conf['show_php_errors']) && !empty($conf['show_php_errors']))
include(PHPWG_ROOT_PATH . 'include/constants.php');
include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
+include(PHPWG_ROOT_PATH . 'include/template.class.php');
+include(PHPWG_ROOT_PATH . 'include/cache.class.php');
+include(PHPWG_ROOT_PATH . 'include/Logger.class.php');
$persistent_cache = new PersistentFileCache();
@@ -122,6 +125,17 @@ pwg_db_check_charset();
load_conf_from_db();
+$logger = new Logger(array(
+ 'directory' => PHPWG_ROOT_PATH . $conf['data_location'] . $conf['log_dir'],
+ 'severity' => $conf['log_level'],
+ // we use an hashed filename to prevent direct file access, and we salt with
+ // the db_password instead of secret_key because the log must be usable in i.php
+ // (secret_key is in the database)
+ 'filename' => 'log_' . date('Y-m-d') . '_' . sha1(date('Y-m-d') . $conf['db_password']) . '.txt',
+ 'globPattern' => 'log_*.txt',
+ 'archiveDays' => $conf['log_archive_days'],
+ ));
+
if (!$conf['check_upgrade_feed'])
{
if (!isset($conf['piwigo_db_version']) or $conf['piwigo_db_version'] != get_branch_from_version(PHPWG_VERSION))