1
0
Fork 0

add client path for configuration

Dieser Commit ist enthalten in:
o.pinke 2021-04-22 11:15:21 +02:00
Ursprung be253de493
Commit 3217b73d08
1 geänderte Dateien mit 19 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -673,9 +673,25 @@ function mr_getConfiguration($clientId) {
* @return bool
*/
function mr_setConfiguration($clientId, array $config) {
global $cfg;
$file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/includes/config.mod_rewrite_' . $clientId . '.php';
$sClientPath = cRegistry::getClientConfig(cRegistry::getClientId())['path']['frontend'];
$sConfigClientPath = $sClientPath.'/data/config/'.CL_ENVIRONMENT.'/';
if (is_writable($sClientPath) && !file_exists($sConfigClientPath)) {
try {
mkdir($sConfigClientPath, 0777, true);
} catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", array('destination' => 'contenido.log'));
$oLog = new cLog($oWriter);
$oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
}
}
if(file_exists($sConfigClientPath) && is_writable($sConfigClientPath)) {
$file = $sConfigClientPath. 'config.mod_rewrite.php';
} else {
$file = cRegistry::getConfigValue('path', 'contenido') . cRegistry::getConfigValue('path', 'plugins') . 'cl-mod-rewrite/includes/config.mod_rewrite_' . cRegistry::getClientId() . '.php';
}
$result = file_put_contents($file, serialize($config));
return ($result) ? true : false;
}