mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-23 01:01:20 +00:00

- add `.env.example` and `INSTALL.md` to castopod bundle for installation docs - update seeders to be silent on insert errors - update install layout - add manual config instructions when .env file is not writable - fix eslint error in Charts.ts module closes #32
23 lines
511 B
PHP
23 lines
511 B
PHP
<?php
|
|
|
|
if (!function_exists('host_url')) {
|
|
/**
|
|
* Return the host URL to use in views
|
|
*
|
|
* @return string|false
|
|
*/
|
|
function host_url()
|
|
{
|
|
if (isset($_SERVER['host'])) {
|
|
$protocol =
|
|
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
|
|
$_SERVER['SERVER_PORT'] == 443
|
|
? 'https://'
|
|
: 'http://';
|
|
return $protocol + $_SERVER['host'];
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|