/[drupal]/contributions/modules/sympal_scripts/drupal.php
ViewVC logotype

Contents of /contributions/modules/sympal_scripts/drupal.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sat Aug 5 18:55:21 2006 UTC (3 years, 3 months ago) by ber
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +24 -3 lines
File MIME type: text/x-php
common.php got two new functions, one to retreive all sites installed on your multisite, the other is a start for a new proper argument parsing system
drupal.php now can include many drupal sites in one PHP session. handy if you want to perform batch tasks on a range of sites (such as running cron).
changed crontab into cron.php.
Cron.php is now compatible with the usage docs http://webschuur.com/node/637
1 <?php
2 # Script to include Drupal in the CLI
3
4 /**
5 * Include Drupal!
6 */
7 function installer_include_drupal($site = NULL) {
8 global $drupal_dir, $argv;
9 unset($GLOBALS['base_url']);
10
11 if ($site) {
12 $_SERVER['HTTP_HOST'] = $site;
13 }
14 elseif ($site_arg = parse_dash_arguments('site')) {
15 $_SERVER['HTTP_HOST'] = $site_arg;
16 }
17 else {
18 return FALSE;
19 }
20
21 $php_self_tmp = $_SERVER['PHP_SELF'];
22 $script_name_tmp = $_SERVER['SCRIPT_NAME'];
23
24 $_SERVER['PHP_SELF'] = '/index.php'; //set the domain
25 $_SERVER['SCRIPT_NAME'] = '/index.php';
26
27 $cwd = getcwd();
28 chdir($drupal_dir);
29 include_once('includes/bootstrap.inc');
30 //test if the domain is existing!
31 if (function_exists('conf_init')) {
32 if(strstr(conf_init(),'default')) {
33 //We do not have a proer domain. And we should not test the default instalation on failure
34 return FALSE;
35 }
36 //Drupal included sucessfull!
37 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
38 $here_i_am = $drupal_dir . base_path();
39 }
40
41 chdir($cwd);
42 $_SERVER['PHP_SELF'] = $php_self_tmp;
43 $_SERVER['SCRIPT_NAME'] = $script_name_tmp;
44
45 return $here_i_am;
46 }
47
48 return installer_include_drupal();
49 ?>

  ViewVC Help
Powered by ViewVC 1.1.2