1 --- drupal-4.6.5/update.php 2005-12-20 17:30:16.000000000 +0200
2 +++ drupal-4.6.5/update.php 2005-12-20 18:26:23.000000000 +0200
4 print update_page_footer();
7 +if (php_sapi_name() == 'cli') {
8 + $_SERVER['REMOTE_ADDR'] = '0.0.0.0';
10 + include_once "includes/bootstrap.inc";
11 + include_once "includes/common.inc";
13 + function get_update_index($date) {
14 + global $sql_updates;
16 + $hash = array_flip(array_keys($sql_updates));
17 + if (!isset($hash[$date])) {
20 + return $hash[$date];
23 + if (isset($argv[2])) {
24 + # user specified the date
25 + $start = get_update_index($argv[2]);
26 + if (is_null($start)) {
27 + die("Can't find requested update: $argv[2]\n");
31 + # lookup update date from database
32 + $date = variable_get("update_start", 0);
34 + $start = get_update_index($date);
35 + if (is_null($start)) {
36 + die("No updates available\n");
38 + # but we need next entry instead
42 + # "0" reserved for "All"
45 + $_POST['op'] = $argv[1];
46 + $_POST['edit'] = array(
52 + $page = ob_get_contents();
55 + # primitive html renderer ;)
56 + if (preg_match('#<body>(.+)</body>#s', $page, $m)) {
58 + $page = preg_replace('#<div id="logo">(.*?)</div>#s', '', $page);
59 + $page = preg_replace('#<div id="update">(.*?)</div>#s', '', $page);
62 + echo strip_tags($page), "\n";
66 if (isset($_GET["op"])) {
67 include_once "includes/bootstrap.inc";
68 include_once "includes/common.inc";
69 --- drupal-4.6.5/update.php~ 2006-01-11 21:39:09.000000000 +0200
70 +++ drupal-4.6.5/update.php 2006-01-11 21:39:11.000000000 +0200
72 * check statement below. Change the TRUE into a FALSE to disable the access
73 * check. After finishing the upgrade, be sure to open this file and change the
74 * FALSE back into a TRUE!
77 + * You will need to copy this file to htdocs dir to run it from web and add
78 + * chdir('..'); before first include_once statement.
80 + * You can also run this script from CLI (which is preffered way in PLD Linux):
84 // Disable access checking?