diff options
| author | 2013-12-30 15:00:41 +0100 | |
|---|---|---|
| committer | 2013-12-30 15:00:41 +0100 | |
| commit | bd5d7a7bcb16cff1c01f4445ceee765fc11e3b50 (patch) | |
| tree | 1839dbb208d1b63c034fce2cb3d646124a6c937c /app/Models | |
| parent | 4d6ab45b03031e1c13ac2d3589364a43a0fe5578 (diff) | |
Cache HTTP compatible multi-utilisateur
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/LogDAO.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php index 6205468bd..d1e515200 100644 --- a/app/Models/LogDAO.php +++ b/app/Models/LogDAO.php @@ -1,9 +1,9 @@ <?php class FreshRSS_LogDAO { - public static function lines($user) { + public static function lines() { $logs = array (); - $handle = @fopen(LOG_PATH . '/' . $user . '.log', 'r'); + $handle = @fopen(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', 'r'); if ($handle) { while (($line = fgets($handle)) !== false) { if (preg_match ('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) { @@ -18,4 +18,8 @@ class FreshRSS_LogDAO { } return array_reverse($logs); } + + public static function truncate() { + file_put_contents(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', ''); + } } |
