From: Andrew Dolgov Date: Fri, 5 Nov 2010 13:49:23 +0000 (+0300) Subject: remove read_stampfile() X-Git-Tag: 1.5.0~400 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1ea20897a2f2fdfaf8ec2725771d2ff7c8bf27a7;p=tt-rss.git remove read_stampfile() --- diff --git a/functions.php b/functions.php index be393764..256a6402 100644 --- a/functions.php +++ b/functions.php @@ -2263,26 +2263,6 @@ } } - function read_stampfile($filename) { - - error_reporting(0); - $fp = fopen(LOCK_DIRECTORY . "/$filename", "r"); - error_reporting (DEFAULT_ERROR_LEVEL); - - if ($fp) { - if (flock($fp, LOCK_EX)) { - $stamp = fgets($fp); - flock($fp, LOCK_UN); - fclose($fp); - return $stamp; - } else { - return false; - } - } else { - return false; - } - } - function sql_random_function() { if (DB_TYPE == "mysql") { return "RAND()"; @@ -3223,9 +3203,7 @@ if (time() - $_SESSION["daemon_stamp_check"] > 30) { - $stamp = (int)read_stampfile("update_daemon.stamp"); - -// print ""; + $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); if ($stamp) { $stamp_delta = time() - $stamp; diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index d998c3d9..4d68fb97 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -222,7 +222,7 @@ if ($param == 1) { print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner."); - $stamp = (int)read_stampfile("update_daemon.stamp"); + $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); @@ -242,7 +242,7 @@ if ($param == 3) { print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner."); - $stamp = (int)read_stampfile("update_daemon.stamp"); + $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp"); print "

" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);