| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
define ('RSS_NO_CACHE',true); |
|---|
| 29 |
require_once('init.php'); |
|---|
| 30 |
|
|---|
| 31 |
$cline = isset($argv) && !$_REQUEST && isset($argc) && $argc; |
|---|
| 32 |
if (!$cline && getConfig('rss.config.restrictrefresh')) { |
|---|
| 33 |
die(__('Sorry, updating from the web is currently not allowed.')); |
|---|
| 34 |
} |
|---|
| 35 |
rss_require("cls/update.php"); |
|---|
| 36 |
rss_require("extlib/browser.php"); |
|---|
| 37 |
|
|---|
| 38 |
$sajax_request_type = "POST"; |
|---|
| 39 |
$sajax_debug_mode = 0; |
|---|
| 40 |
$sajax_remote_uri = getPath() . "update.php"; |
|---|
| 41 |
$sajax_export_list = array("ajaxUpdate","ajaxUpdateCleanup"); |
|---|
| 42 |
sajax_init(); |
|---|
| 43 |
|
|---|
| 44 |
if (array_key_exists('js',$_GET)) { |
|---|
| 45 |
header('Content-Type: text/javascript'); |
|---|
| 46 |
ajaxUpdateJavascript(); |
|---|
| 47 |
exit(); |
|---|
| 48 |
} elseif(array_key_exists('rs',$_REQUEST)) { |
|---|
| 49 |
|
|---|
| 50 |
sajax_handle_client_request(); |
|---|
| 51 |
exit(); |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
$browser = new Browser(); |
|---|
| 55 |
$silent = array_key_exists('silent', $_GET) || ($cline && in_array('--silent',$argv)); |
|---|
| 56 |
$newsonly = array_key_exists('newsonly', $_GET) || ($cline && in_array('--newsonly', $argv)); |
|---|
| 57 |
$mobile = array_key_exists('mobile',$_GET); |
|---|
| 58 |
|
|---|
| 59 |
$cid = DEFAULT_CID; |
|---|
| 60 |
if(array_key_exists('cid', $_GET)) { |
|---|
| 61 |
$cid = $_GET['cid']; |
|---|
| 62 |
} else if ($cline && in_array('--update-only', $argv)) { |
|---|
| 63 |
foreach($argv as $k => $v) { |
|---|
| 64 |
if ('--update-only' == $v) { |
|---|
| 65 |
$cid = $argv[$k+1]; |
|---|
| 66 |
break; |
|---|
| 67 |
} |
|---|
| 68 |
} |
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
$GLOBALS['rss'] -> header = new Header( |
|---|
| 72 |
__('Updating'), |
|---|
| 73 |
LOCATION_UPDATE, |
|---|
| 74 |
null, |
|---|
| 75 |
"", |
|---|
| 76 |
(HDR_NONE | HDR_NO_CACHECONTROL ) |
|---|
| 77 |
); |
|---|
| 78 |
|
|---|
| 79 |
$GLOBALS['rss'] -> feedList = new FeedList(false); |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
if ($cline && !$silent && !$newsonly) { |
|---|
| 83 |
$update = new CommandLineUpdate($cid); |
|---|
| 84 |
|
|---|
| 85 |
} elseif ($cline && !$silent && $newsonly) { |
|---|
| 86 |
$update = new CommandLineUpdateNews($cid); |
|---|
| 87 |
|
|---|
| 88 |
} elseif (getConfig('rss.config.serverpush') && !$silent && $browser->supportsServerPush()) { |
|---|
| 89 |
$update = new HTTPServerPushUpdate($cid); |
|---|
| 90 |
|
|---|
| 91 |
} elseif(!$silent && $browser->supportsAJAX()) { |
|---|
| 92 |
$update = new AJAXUpdate($cid); |
|---|
| 93 |
|
|---|
| 94 |
} elseif($mobile) { |
|---|
| 95 |
$update = new MobileUpdate($cid); |
|---|
| 96 |
|
|---|
| 97 |
} else { |
|---|
| 98 |
error_reporting(0); |
|---|
| 99 |
$update = new SilentUpdate($cid); |
|---|
| 100 |
} |
|---|
| 101 |
|
|---|
| 102 |
$GLOBALS['rss'] -> appendContentObject($update); |
|---|
| 103 |
if (!$silent && !$cline) { |
|---|
| 104 |
$GLOBALS['rss'] -> renderWithTemplate('index.php','update'); |
|---|
| 105 |
} else { |
|---|
| 106 |
$update->render(); |
|---|
| 107 |
} |
|---|
| 108 |
|
|---|
| 109 |
?> |
|---|
| 110 |
|
|---|