public function loadRouter($base = null)
{
if ($base === null) {
$base = Configure::read('App.base');
}
if (!class_exists('Router')) {
App::import('Core', 'Router');
}
Router::setRequestInfo(array(array(), array('base' => $base, 'webroot' => $base)));
if (!defined('FULL_BASE_URL')) {
$s = null;
if (env('HTTPS')) {
$s = 's';
}
$httpHost = env('HTTP_HOST');
if (empty($httpHost)) {
$httpHost = env('SERVER_NAME');
if (empty($httpHost)) {
if (class_exists('Environment')) {
$httpHost = Environment::getHostName();
}
}
}
if (!empty($httpHost)) {
define('FULL_BASE_URL', 'http' . $s . '://' . $httpHost);
}
}
}