3 define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE
);
4 define('DISABLE_SESSIONS', true);
6 error_reporting(DEFAULT_ERROR_LEVEL
);
8 require_once "sanity_check.php";
9 require_once "config.php";
10 require_once "db.php";
11 require_once "db-prefs.php";
12 require_once "functions.php";
14 $lock_filename = "update_feeds.lock";
16 $lock_handle = make_lockfile($lock_filename);
18 // Try to lock a file in order to avoid concurrent update.
20 die("error: Can't create lockfile ($lock_filename). ".
21 "Maybe another process is already running.\n");
24 // Create a database connection.
25 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
28 if (DB_TYPE
== "mysql") {
31 // PG seems to display its own errors just fine by default.
35 init_connection($link);
37 // Purge all posts (random 30 feeds)
38 //global_purge_old_posts($link, true, 30);
40 // Update all feeds needing a update.
41 update_daemon_common($link);
45 unlink(LOCK_DIRECTORY
. "/$lock_filename");