aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-12-28 18:05:02 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-12-28 18:05:02 +0100
commitc391ca62f1ad4130202b995bb5bb9111894e65ff (patch)
tree77165b1b577bd1be269ed0a2b93dbd4944842860
parent039a83759d41615aaa593fa62deff4c25fc126a2 (diff)
Remove all old references to LOG_PATH
See https://github.com/FreshRSS/FreshRSS/issues/729
-rwxr-xr-xapp/actualize_script.php4
-rw-r--r--lib/Minz/FrontController.php4
-rw-r--r--lib/Minz/Log.php6
-rw-r--r--lib/lib_rss.php7
-rw-r--r--p/api/greader.php2
-rwxr-xr-xp/i/index.php4
6 files changed, 13 insertions, 14 deletions
diff --git a/app/actualize_script.php b/app/actualize_script.php
index 6ce4178cd..e8bc67c10 100755
--- a/app/actualize_script.php
+++ b/app/actualize_script.php
@@ -56,9 +56,9 @@ foreach ($users as $myUser) {
$freshRSS->run();
if (!invalidateHttpCache()) {
- syslog(LOG_NOTICE, 'FreshRSS write access problem in ' . LOG_PATH . '/*.log!');
+ syslog(LOG_NOTICE, 'FreshRSS write access problem in ' . USERS_PATH . '/*/log.txt!');
if (defined('STDERR')) {
- fwrite(STDERR, 'Write access problem in ' . LOG_PATH . '/*.log!' . "\n");
+ fwrite(STDERR, 'Write access problem in ' . USERS_PATH . '/*/log.txt!' . "\n");
}
}
Minz_Session::unset_session(true);
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php
index e95c56bf3..3dac1e438 100644
--- a/lib/Minz/FrontController.php
+++ b/lib/Minz/FrontController.php
@@ -30,10 +30,6 @@ class Minz_FrontController {
* Initialise le dispatcher, met à jour la Request
*/
public function __construct () {
- if (LOG_PATH === false) {
- $this->killApp ('Path not found: LOG_PATH');
- }
-
try {
Minz_Configuration::init ();
diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php
index 26412c547..d19edc1dc 100644
--- a/lib/Minz/Log.php
+++ b/lib/Minz/Log.php
@@ -28,7 +28,7 @@ class Minz_Log {
* - level = NOTICE et environment = PRODUCTION
* @param $information message d'erreur / information à enregistrer
* @param $level niveau d'erreur
- * @param $file_name fichier de log, par défaut LOG_PATH/application.log
+ * @param $file_name fichier de log
*/
public static function record ($information, $level, $file_name = null) {
$env = Minz_Configuration::environment ();
@@ -37,7 +37,7 @@ class Minz_Log {
|| ($env === Minz_Configuration::PRODUCTION
&& ($level >= Minz_Log::NOTICE)))) {
if ($file_name === null) {
- $file_name = join_path(DATA_PATH, 'users', Minz_Session::param('currentUser', '_'), 'log.txt');
+ $file_name = join_path(USERS_PATH, Minz_Session::param('currentUser', '_'), 'log.txt');
}
switch ($level) {
@@ -71,7 +71,7 @@ class Minz_Log {
* Automatise le log des variables globales $_GET et $_POST
* Fait appel à la fonction record(...)
* Ne fonctionne qu'en environnement "development"
- * @param $file_name fichier de log, par défaut LOG_PATH/application.log
+ * @param $file_name fichier de log
*/
public static function recordRequest($file_name = null) {
$msg_get = str_replace("\n", '', '$_GET content : ' . print_r($_GET, true));
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index cc60a1607..d450ec858 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -222,7 +222,10 @@ function invalidateHttpCache() {
function listUsers() {
$final_list = array();
$base_path = join_path(DATA_PATH, 'users');
- $dir_list = array_values(array_diff(scandir($base_path), array('..', '.')));
+ $dir_list = array_values(array_diff(
+ scandir($base_path),
+ array('..', '.', '_')
+ ));
foreach ($dir_list as $file) {
if (is_dir(join_path($base_path, $file))) {
@@ -297,7 +300,7 @@ function check_install_files() {
return array(
'data' => DATA_PATH && is_writable(DATA_PATH),
'cache' => CACHE_PATH && is_writable(CACHE_PATH),
- 'logs' => LOG_PATH && is_writable(LOG_PATH),
+ 'users' => USERS_PATH && is_writable(USERS_PATH),
'favicons' => is_writable(DATA_PATH . '/favicons'),
'persona' => is_writable(DATA_PATH . '/persona'),
'tokens' => is_writable(DATA_PATH . '/tokens'),
diff --git a/p/api/greader.php b/p/api/greader.php
index 1a66c30fb..80714d478 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -77,7 +77,7 @@ class MyPDO extends Minz_ModelPdo {
}
function logMe($text) {
- file_put_contents(LOG_PATH . '/api.log', $text, FILE_APPEND);
+ file_put_contents(join_path(USERS_PATH, '_', 'log_api.txt'), $text, FILE_APPEND);
}
function debugInfo() {
diff --git a/p/i/index.php b/p/i/index.php
index ec969c159..009d56bc3 100755
--- a/p/i/index.php
+++ b/p/i/index.php
@@ -32,8 +32,8 @@ if (file_exists(DATA_PATH . '/do-install.txt')) {
require(LIB_PATH . '/http-conditional.php');
$currentUser = Minz_Session::param('currentUser', '');
$dateLastModification = $currentUser === '' ? time() : max(
- @filemtime(LOG_PATH . '/' . $currentUser . '.log'),
- @filemtime(DATA_PATH . '/config.php')
+ @filemtime(join_path(USERS_PATH, $currentUser, 'log.txt')),
+ @filemtime(join_path(DATA_PATH . 'config.php'))
);
if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) {
exit(); //No need to send anything