Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Base URL #40

Merged
merged 1 commit into from
Jun 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/CeesVanEgmond/Minify/Minify.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,17 @@ private function checkConfiguration(array $config)
* @return string
*/
private function getBaseUrl()
{
return sprintf("%s://%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['HTTP_HOST']
);
{
if (is_null($this->config['base_url']) || (trim($this->config['base_url']) == ''))
{
return sprintf("%s://%s",
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
$_SERVER['HTTP_HOST']
);
}
else
{
return $this->config['base_url'];
}
}
}
}
1 change: 1 addition & 0 deletions src/CeesVanEgmond/Minify/MinifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function register()
'css_build_path' => Config::get('minify::css_build_path'),
'js_build_path' => Config::get('minify::js_build_path'),
'ignore_environments' => Config::get('minify::ignore_environments'),
'base_url' => Config::get('minify::base_url'),
),
$app->environment()
);
Expand Down
12 changes: 11 additions & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@

'js_build_path' => '/js/builds/',

);
/*
|--------------------------------------------------------------------------
| Base URL
|--------------------------------------------------------------------------
|
| You can set the base URL for the links generated with the configuration
| value. By default if empty HTTP_HOST would be used.
|
*/
'base_url' => ''
);