<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
| Copyright Tech To The People http:tttp.eu (c) 2008 |
+--------------------------------------------------------------------+
chdir($civicrm_root);
require_once ('civicrm.config.php');
// autoload
- require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
+ if ( !class_exists('CRM_Core_ClassLoader') ) {
+ require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
+ }
CRM_Core_ClassLoader::singleton()->register();
$this->_config = CRM_Core_Config::singleton();
+
+ // HTTP_HOST will be 'localhost' unless overwritten with the -s argument.
+ // Now we have a Config object, we can set it from the Base URL.
+ if ($_SERVER['HTTP_HOST'] == 'localhost') {
+ $_SERVER['HTTP_HOST'] = preg_replace(
+ '!^https?://([^/]+)/$!i',
+ '$1',
+ $this->_config->userFrameworkBaseURL);
+ }
$class = 'CRM_Utils_System_' . $this->_config->userFramework;