Added base_uri to config classes
This commit is contained in:
parent
74c426e83d
commit
244b6eca24
3 changed files with 8 additions and 9 deletions
|
@ -65,8 +65,9 @@ class Standard extends \Baikal\Model\Config {
|
||||||
"cal_enabled" => true,
|
"cal_enabled" => true,
|
||||||
"dav_auth_type" => "Digest",
|
"dav_auth_type" => "Digest",
|
||||||
"admin_passwordhash" => "",
|
"admin_passwordhash" => "",
|
||||||
"auth_realm" => "BaikalDAV"
|
"auth_realm" => "BaikalDAV",
|
||||||
];
|
"base_uri" => ""
|
||||||
|
];
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
$this->aData["invite_from"] = "noreply@" . $_SERVER['SERVER_NAME']; // Default value
|
$this->aData["invite_from"] = "noreply@" . $_SERVER['SERVER_NAME']; // Default value
|
||||||
|
|
|
@ -204,24 +204,21 @@ class Framework extends \Flake\Core\Framework {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function defineBaseUri() {
|
protected static function defineBaseUri() {
|
||||||
$usedBaseUriFromConfig = false;
|
|
||||||
try {
|
try {
|
||||||
$config = Yaml::parseFile(PROJECT_PATH_CONFIG . "baikal.yaml");
|
$config = Yaml::parseFile(PROJECT_PATH_CONFIG . "baikal.yaml");
|
||||||
if (isset($config["system"]["base_uri"]) && $config["system"]["base_uri"] !== "") {
|
if (isset($config["system"]["base_uri"]) && $config["system"]["base_uri"] !== "") {
|
||||||
// SabreDAV needs a "/" at the beginning of BASEURL
|
// SabreDAV needs a "/" at the beginning of BASEURL
|
||||||
define("PROJECT_BASEURI", self::prependSlash($config["system"]["base_uri"]));
|
define("PROJECT_BASEURI",
|
||||||
|
self::prependSlash(self::appendSlash($config["system"]["base_uri"])));
|
||||||
define("PROJECT_URI", \Flake\Util\Tools::getCurrentProtocol() . "://"
|
define("PROJECT_URI", \Flake\Util\Tools::getCurrentProtocol() . "://"
|
||||||
. $_SERVER["HTTP_HOST"] . PROJECT_BASEURI);
|
. $_SERVER["HTTP_HOST"] . PROJECT_BASEURI);
|
||||||
$usedBaseUriFromConfig = true;
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
error_log($e);
|
error_log($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($usedBaseUriFromConfig) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sScript = substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"]));
|
$sScript = substr($_SERVER["SCRIPT_FILENAME"], strlen($_SERVER["DOCUMENT_ROOT"]));
|
||||||
$sDirName = str_replace("\\", "/", dirname($sScript)); // fix windows backslashes
|
$sDirName = str_replace("\\", "/", dirname($sScript)); // fix windows backslashes
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ system:
|
||||||
dav_auth_type: 'Digest'
|
dav_auth_type: 'Digest'
|
||||||
admin_passwordhash: 5fe794627e1f841f8debba065e2c807a
|
admin_passwordhash: 5fe794627e1f841f8debba065e2c807a
|
||||||
auth_realm: BaikalDAV
|
auth_realm: BaikalDAV
|
||||||
|
base_uri: ''
|
||||||
database:
|
database:
|
||||||
encryption_key: 5d3f0fa0192e3058ea70f1bb20924add
|
encryption_key: 5d3f0fa0192e3058ea70f1bb20924add
|
||||||
sqlite_file: "absolute/path/to/Specific/db/db.sqlite"
|
sqlite_file: "absolute/path/to/Specific/db/db.sqlite"
|
||||||
|
|
Loading…
Reference in a new issue