]> git.wh0rd.org - tt-rss.git/commitdiff
remove read_stampfile()
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 5 Nov 2010 13:49:23 +0000 (16:49 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 5 Nov 2010 13:49:23 +0000 (16:49 +0300)
functions.php
modules/popup-dialog.php

index be3937642109f241792158784d1c66092f3cc7f2..256a6402eb7db893f85187a9760a839a1ea04035 100644 (file)
                }
        }
 
-       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()";
 
                        if (time() - $_SESSION["daemon_stamp_check"] > 30) {
 
-                               $stamp = (int)read_stampfile("update_daemon.stamp");
-
-//                             print "<param key=\"daemon_stamp_delta\" value=\"$stamp_delta\"/>";
+                               $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
 
                                if ($stamp) {
                                        $stamp_delta = time() - $stamp;
index d998c3d96b0415770a1134809a44b6949d542599..4d68fb9712fa8c758d4a793188255cb91c01efb4 100644 (file)
                        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 "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp); 
 
                        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 "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);