]> git.wh0rd.org - tt-rss.git/blame - update_feeds.php
tagwall: remove forced strtolower() on TW_URL attributes (closes #145)
[tt-rss.git] / update_feeds.php
CommitLineData
cd2cd415 1#!/usr/bin/php
1d3a17c7 2<?php
1f2b01ed
AD
3 // this script is probably run not from your httpd-user, so cache
4 // directory defined in config.php won't be accessible
5 define('MAGPIE_CACHE_DIR', '/var/tmp/magpie-ttrss-cache-cli');
6
de696427
AD
7 define('DISABLE_SESSIONS', true);
8
1f2b01ed
AD
9 require_once "sanity_check.php";
10 require_once "config.php";
11 require_once "db.php";
12 require_once "db-prefs.php";
13 require_once "functions.php";
14 require_once "magpierss/rss_fetch.inc";
15
16 $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
17
18 if (!$link) {
19 if (DB_TYPE == "mysql") {
20 print mysql_error();
21 }
22 // PG seems to display its own errors just fine by default.
23 return;
24 }
25
26 if (DB_TYPE == "pgsql") {
27 pg_query("set client_encoding = 'utf-8'");
ef063748 28 pg_set_client_encoding("UNICODE");
70dcff6b 29 } else {
bddc9788
AD
30 if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) {
31 db_query($link, "SET NAMES " . MYSQL_CHARSET);
75ca1986 32// db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET);
bddc9788 33 }
1f2b01ed
AD
34 }
35
36 $result = db_query($link, "SELECT id FROM ttrss_users");
37
38 while ($line = db_fetch_assoc($result)) {
39 $user_id = $line["id"];
e7dfc9c9 40 initialize_user_prefs($link, $user_id);
1f2b01ed
AD
41 update_all_feeds($link, false, $user_id, true);
42 }
43
99018440 44 if (DAEMON_SENDS_DIGESTS) send_headlines_digests($link);
9cd7c995 45
1f2b01ed
AD
46 db_close($link);
47
48?>