<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/**
 * Modular Extensions - HMVC
 * Adapted from wiredesignz codeigniter-modular-extensions-hmvc 5.5
 *
 * This file bootstraps the HMVC system. It is included by MY_Loader / MY_Router
 * via the core classes, and registers the module locations.
 */

/* set the module locations and offsets */
if (is_file(APPPATH.'config/'.ENVIRONMENT.'/modules.php'))
{
	include APPPATH.'config/'.ENVIRONMENT.'/modules.php';
}
elseif (is_file(APPPATH.'config/modules.php'))
{
	include APPPATH.'config/modules.php';
}

/* set the default module locations if none are defined */
if ( ! isset($modules_locations))
{
	$modules_locations = array(
		APPPATH.'modules/' => '../modules/',
	);
}

Modules::$locations = $modules_locations;

/* PHP5 spl_autoload */
spl_autoload_register('Modules::autoload');
