Commit 779e38c2 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Provide provision_internal_init which allows us to integrate the external drupal_x scripts.

parent 9f516b40
<?php
// $Id$
require_once(dirname(__FILE__) . '/../provision.inc');
if ($argv[1]) {
// Fake the necessary HTTP headers that Drupal needs:
$data = provision_external_init($argv[1], FALSE);
}
else {
provision_set_error(PROVISION_FRAMEWORK_ERROR);
provision_log("error", "USAGE: drupal_update.php url\n");
provision_output($url, $data);
}
/**
* @file
* Update.php for provisioned sites.
......@@ -131,4 +119,3 @@ function _update_do_one($module, $number, &$context) {
}
update_main();
provision_output($data);
......@@ -6,8 +6,6 @@ function provision_drupal_provision_update_validate() {
}
function provision_drupal_provision_update(&$data, $url) {
$cmd = sprintf("php %s/drupal_update.php %s", dirname(__FILE__), $url);
provision_exec($cmd, $data);
provision_internal_init($data['site_url'], false);
include_once(sprintf('%s/drupal_update.inc', dirname(__FILE__)));
}
......@@ -797,6 +797,23 @@ function provision_external_init($url, $bootstrap = TRUE) {
return TRUE;
}
function provision_internal_init($url, $bootstrap = TRUE) {
$url = ($url) ? $url : 'default';
$drupal_base_url = parse_url(sprintf("http://" . $url));
$_SERVER['HTTP_HOST'] = $drupal_base_url['host'];
$_SERVER['PHP_SELF'] = $drupal_base_url['path'].'/install.php';
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'];
$_SERVER['REMOTE_ADDR'] = '';
$_SERVER['REQUEST_METHOD'] = NULL;
$_SERVER['SERVER_SOFTWARE'] = NULL;
if ($bootstrap) {
include_once('includes/bootstrap.inc');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
}
function provision_password($length = 10) {
// This variable contains the list of allowable characters for the
// password. Note that the number 0 and the letter 'O' have been
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment