add client path for configuration
Dieser Commit ist enthalten in:
Ursprung
be253de493
Commit
3217b73d08
1 geänderte Dateien mit 19 neuen und 3 gelöschten Zeilen
|
@ -673,9 +673,25 @@ function mr_getConfiguration($clientId) {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function mr_setConfiguration($clientId, array $config) {
|
function mr_setConfiguration($clientId, array $config) {
|
||||||
global $cfg;
|
$sClientPath = cRegistry::getClientConfig(cRegistry::getClientId())['path']['frontend'];
|
||||||
|
$sConfigClientPath = $sClientPath.'/data/config/'.CL_ENVIRONMENT.'/';
|
||||||
$file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/includes/config.mod_rewrite_' . $clientId . '.php';
|
|
||||||
|
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));
|
$result = file_put_contents($file, serialize($config));
|
||||||
return ($result) ? true : false;
|
return ($result) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren