Esempio n. 1
0
<?php

// Be hacky/lazy and just use the same DRUPAL_ROOT namespace
define('DRUPAL_ROOT', dirname(realpath(__FILE__)));
// Load the general includes file.
require_once DRUPAL_ROOT . '/includes/gen.inc';
// Load up ALL the includes.
load_includes();
// Fire up the bootstrap-imitating conf_init()
conf_init();
// install_schemas();
$file = '/home/sdboyer/Documents/Academic/Padgett.PLSC57500/final/devarchive/2005-January.txt';
date_default_timezone_set('UTC');
$archive = new MailmanArchiveParser($file);
// $dat = introspect_spl_class($archive);
foreach ($archive as $item) {
    $db = new DbUpdater($item);
    $db->prepData();
}
$i = 'break on me';
     * above us, so use that
     */
    $currentDir = dirname(__FILE__) . '/';
    if (file_exists($currentDir . 'settings_location.php')) {
        include $currentDir . 'settings_location.php';
    }
    if (defined('CIVICRM_CONFDIR')) {
        $confdir = CIVICRM_CONFDIR;
    } else {
        // make it relative to civicrm.config.php, else php makes it relative
        // to the script that invokes it
        $confdir = $currentDir . '../../sites';
    }
    $phpSelf = array_key_exists('PHP_SELF', $_SERVER) ? $_SERVER['PHP_SELF'] : '';
    $httpHost = array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : '';
    $uri = explode('/', $phpSelf);
    $server = explode('.', implode('.', array_reverse(explode(':', rtrim($httpHost, '.')))));
    for ($i = count($uri) - 1; $i > 0; $i--) {
        for ($j = count($server); $j > 0; $j--) {
            $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
            if (file_exists("{$confdir}/{$dir}/civicrm.settings.php")) {
                $conf = "{$confdir}/{$dir}";
                return $conf;
            }
        }
    }
    $conf = "{$confdir}/default";
    return $conf;
}
include_once conf_init() . '/civicrm.settings.php';