Adapt BaseURL calls to new UriInterface

This commit is contained in:
Philipp 2023-02-18 20:57:30 +01:00
parent 9e6d95284b
commit f0c29edcde
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
101 changed files with 218 additions and 241 deletions

View file

@ -73,7 +73,7 @@ class Cache
public function __construct(BaseURL $baseURL, IManageConfigValues $config, Database $dba, Profiler $profiler, LoggerInterface $logger)
{
$this->hostname = $baseURL->getHostname();
$this->hostname = $baseURL->getHost();
$this->config = $config;
$this->dba = $dba;
$this->profiler = $profiler;

View file

@ -76,7 +76,7 @@ class Renderer
DI::profiler()->startRecording('rendering');
// pass $baseurl to all templates if it isn't set
$vars = array_merge(['$baseurl' => DI::baseUrl()->get(), '$APP' => DI::app()], $vars);
$vars = array_merge(['$baseurl' => DI::baseUrl(), '$APP' => DI::app()], $vars);
$t = self::getTemplateEngine();

View file

@ -37,7 +37,7 @@ class Native extends AbstractSession implements IHandleSessions
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', (int)Cookie::HTTPONLY);
if ($baseURL->getSSLPolicy() == App\BaseURL::SSL_POLICY_FULL) {
if ($baseURL->getScheme() === 'https') {
ini_set('session.cookie_secure', 1);
}

View file

@ -401,7 +401,7 @@ class System
if (is_bool($prefix) && !$prefix) {
$prefix = '';
} elseif (empty($prefix)) {
$prefix = hash('crc32', DI::baseUrl()->getHostname());
$prefix = hash('crc32', DI::baseUrl()->getHost());
}
while (strlen($prefix) < ($size - 13)) {
@ -604,7 +604,7 @@ class System
$temppath = BasePath::getRealPath($temppath);
// To avoid any interferences with other systems we create our own directory
$new_temppath = $temppath . "/" . DI::baseUrl()->getHostname();
$new_temppath = $temppath . "/" . DI::baseUrl()->getHost();
if (!is_dir($new_temppath)) {
/// @TODO There is a mkdir()+chmod() upwards, maybe generalize this (+ configurable) into a function/method?
mkdir($new_temppath);