2016-04-30 18:47:48 +03:00
|
|
|
<?php
|
2019-10-05 18:26:10 +03:00
|
|
|
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-01-20 22:16:37 +03:00
|
|
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
2021-08-07 12:05:20 +03:00
|
|
|
|
2021-09-26 12:20:29 +03:00
|
|
|
use const Shlinkio\Shlink\DEFAULT_SHORT_CODES_LENGTH;
|
|
|
|
use const Shlinkio\Shlink\MIN_SHORT_CODES_LENGTH;
|
2021-08-07 12:05:20 +03:00
|
|
|
|
|
|
|
return (static function (): array {
|
2021-12-10 18:24:38 +03:00
|
|
|
$shortCodesLength = max(
|
2022-01-20 22:16:37 +03:00
|
|
|
(int) EnvVars::DEFAULT_SHORT_CODES_LENGTH()->loadFromEnv(DEFAULT_SHORT_CODES_LENGTH),
|
2021-12-10 18:24:38 +03:00
|
|
|
MIN_SHORT_CODES_LENGTH,
|
|
|
|
);
|
2020-02-18 20:54:40 +03:00
|
|
|
|
2021-08-07 12:05:20 +03:00
|
|
|
return [
|
2016-04-30 18:47:48 +03:00
|
|
|
|
2021-08-07 12:05:20 +03:00
|
|
|
'url_shortener' => [
|
2022-04-23 11:32:07 +03:00
|
|
|
'domain' => [ // TODO Refactor this structure to url_shortener.schema and url_shortener.default_domain
|
2022-01-20 22:16:37 +03:00
|
|
|
'schema' => ((bool) EnvVars::IS_HTTPS_ENABLED()->loadFromEnv(true)) ? 'https' : 'http',
|
|
|
|
'hostname' => EnvVars::DEFAULT_DOMAIN()->loadFromEnv(''),
|
2021-08-07 12:05:20 +03:00
|
|
|
],
|
|
|
|
'default_short_codes_length' => $shortCodesLength,
|
2022-01-20 22:16:37 +03:00
|
|
|
'auto_resolve_titles' => (bool) EnvVars::AUTO_RESOLVE_TITLES()->loadFromEnv(false),
|
|
|
|
'append_extra_path' => (bool) EnvVars::REDIRECT_APPEND_EXTRA_PATH()->loadFromEnv(false),
|
2016-05-01 12:21:54 +03:00
|
|
|
],
|
2021-08-07 12:05:20 +03:00
|
|
|
|
|
|
|
];
|
|
|
|
})();
|