1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 12:45:56 +00:00

update_rss_feed: simplify debug reporting

This commit is contained in:
Andrew Dolgov
2013-04-19 13:24:51 +04:00
parent ebec81a6fb
commit 9ec103525d
2 changed files with 74 additions and 150 deletions

View File

@@ -129,6 +129,9 @@
$utc_tz = new DateTimeZone('UTC');
$schema_version = false;
global $_debug_enabled;
$_debug_enabled = true;
/**
* Print a timestamped debug message.
*
@@ -136,6 +139,10 @@
* @return void
*/
function _debug($msg) {
global $_debug_enabled;
if (!$_debug_enabled) return;
$ts = strftime("%H:%M:%S", time());
if (function_exists('posix_getpid')) {
$ts = "$ts/" . posix_getpid();
@@ -156,6 +163,15 @@
} // function _debug
function _debug_enable($enabled) {
global $_debug_enabled;
$old = $_debug_enabled;
$_debug_enabled = $enabled;
return $old;
}
/**
* Purge a feed old posts.
*