mirror of
https://github.com/danpros/htmly.git
synced 2026-04-20 20:46:26 +05:30
Improve multi urls
site.url not set will similar to multi.site true
This commit is contained in:
parent
b2ee9cecc8
commit
b024bcf662
2 changed files with 3 additions and 8 deletions
|
|
@ -14,11 +14,9 @@ function _log($message)
|
||||||
|
|
||||||
function site_url()
|
function site_url()
|
||||||
{
|
{
|
||||||
if (config('multi.site') == "true"){
|
if (config('multi.site') == "true" || config('site.url') == null){
|
||||||
return rtrim(generateSiteUrl(), '/') . '/';
|
return rtrim(generateSiteUrl(), '/') . '/';
|
||||||
} else {
|
} else {
|
||||||
if (config('site.url') == null)
|
|
||||||
error(500, '[site.url] is not set');
|
|
||||||
// Forcing the forward slash
|
// Forcing the forward slash
|
||||||
return rtrim(config('site.url'), '/') . '/';
|
return rtrim(config('site.url'), '/') . '/';
|
||||||
}
|
}
|
||||||
|
|
@ -45,9 +43,6 @@ function site_path()
|
||||||
{
|
{
|
||||||
static $_path;
|
static $_path;
|
||||||
|
|
||||||
if (config('site.url') == null)
|
|
||||||
error(500, '[site.url] is not set');
|
|
||||||
|
|
||||||
if (!$_path)
|
if (!$_path)
|
||||||
$_path = rtrim(parse_url(site_url(), PHP_URL_PATH), '/');
|
$_path = rtrim(parse_url(site_url(), PHP_URL_PATH), '/');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2623,6 +2623,7 @@ EOF;
|
||||||
// The not found error
|
// The not found error
|
||||||
function not_found()
|
function not_found()
|
||||||
{
|
{
|
||||||
|
if (!config('views.root')) die('HTMLy is not installed!');
|
||||||
$vroot = rtrim(config('views.root'), '/');
|
$vroot = rtrim(config('views.root'), '/');
|
||||||
$lt = $vroot . '/layout--404.html.php';
|
$lt = $vroot . '/layout--404.html.php';
|
||||||
if (file_exists($lt)) {
|
if (file_exists($lt)) {
|
||||||
|
|
@ -3161,8 +3162,7 @@ function head_contents()
|
||||||
function file_cache($request)
|
function file_cache($request)
|
||||||
{
|
{
|
||||||
if (config('cache.off') == 'true') return;
|
if (config('cache.off') == 'true') return;
|
||||||
|
$hour = config('cache.expiration');
|
||||||
$hour = str_replace(',', '.', config('cache.expiration'));
|
|
||||||
if (empty($hour)) {
|
if (empty($hour)) {
|
||||||
$hour = 6;
|
$hour = 6;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue