mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Merge pull request #2726 from aynsix/PHRAS-2205-saving-configuration-file
PHRAS-2205 Change the configuration file content update methode : when saving from admin/setup
This commit is contained in:
@@ -234,19 +234,11 @@ class Configuration implements ConfigurationInterface
|
|||||||
|
|
||||||
private function dumpFile($file, $content, $mod = 0600)
|
private function dumpFile($file, $content, $mod = 0600)
|
||||||
{
|
{
|
||||||
$tmpFile = tempnam(dirname($file), basename($file));
|
if(false === @file_put_contents($file, $content)){
|
||||||
|
throw new RuntimeException(sprintf('Unable to write %s', $file));
|
||||||
if (false !== @file_put_contents($tmpFile, $content)) {
|
}else{
|
||||||
// rename does not work on Win32 before 5.2.6
|
@chmod($file, $mod & ~umask());
|
||||||
if (@rename($tmpFile, $file)) {
|
|
||||||
@chmod($file, $mod & ~umask());
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink($tmpFile);
|
|
||||||
throw new RuntimeException(sprintf('Unable to write %s', $file));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function eraseFile($file)
|
private function eraseFile($file)
|
||||||
|
|||||||
Reference in New Issue
Block a user