<?php

// FOR INSTALLATIONS RUNNING dmABS IN A SUBDIRECTORY,
// OR USING ALIASING DOMAINS TO A SUBDIRECTORY CONTAINING dmABS
// -----------------------------------------------------------------------------
// Set the path to the dmABS root
// if you are not running the dmABS code in the root dircetory
//
// This data allows the same code to run on different servers, reducing maintenance.
// Specify as many different host and path combinations as you like
//
// Format:
// $abs_path[] = array('name' = <HOSTNAME>, 'path' = <dmABS_ROOT_DIRECTORY>);
// eg. $abs_path[] = array('name' => 'localhost', 'path' => '/test-server/dmabs');
// Note: No trailing slash in 'path'
//
// This variable has no effect on installations of XComponents running
// independently of dmABS

$abs_path[] = array('name' => 'www.yourdomain.com',       'path' => '/dmnumbers');

// -----------------------------------------------------------------------------

$abs_root = '';
if (isset($abs_path)) {
	foreach($abs_path as $host) {
		if ($host['name'] == $_SERVER['HTTP_HOST']) $abs_root = $host['path'];
	}
}
// If the path contains {VERSION} and the URL contains '/code_*, replace {VERSION} with code_*
// (where code_* is code_01, code_02, code_02_revisionB, etc)
// This allows multiple vesrions of dmABS to run from one server (in different directories)
if (strpos($abs_root, '{VERSION}') !== FALSE) {
	preg_match('/code_[\w|_|-]+/', $_SERVER['PHP_SELF'], $match);
	$abs_code_version = $match[0];
	$abs_root = str_replace('{VERSION}', $abs_code_version, $abs_root);
}

?>
