Prefs fail if configDir is not writable

This commit is contained in:
Thomas Gelf 2013-08-20 22:00:05 +02:00 committed by Eric Lippmann
parent 4237e3e53e
commit d181e8018b

View File

@ -151,9 +151,14 @@ class IniStore implements LoadInterface, FlushObserverInterface
*/ */
private function createDefaultIniFile() private function createDefaultIniFile()
{ {
touch($this->preferencesFile); // TODO: We should be able to work without preferences. Also we shouldn't store any
// prefs as long as we didn't change some.
if (! is_writable($this->configPath) || touch($this->preferencesFile) === false) {
throw new ConfigurationError(
sprintf('Unable to store "%s"', $this->preferencesFile)
);
}
chmod($this->preferencesFile, 0664); chmod($this->preferencesFile, 0664);
} }
/** /**