From 6d9174815e98411074e93f4c7c5f9f6cf226e89d Mon Sep 17 00:00:00 2001 From: tagru Date: Wed, 22 Jan 2020 19:34:25 +0100 Subject: [PATCH] Fixes #7 --- src/Config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Config.php b/src/Config.php index f1d9d4a..c7e29c8 100644 --- a/src/Config.php +++ b/src/Config.php @@ -22,14 +22,14 @@ public function __construct(){ $this->basedir = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR; $this->file = $this->basedir.'config.txt'; if(!file_exists($this->file )){ - if(!is_writable ($this->file)){ - throw new ConfigException(sprintf('file '.$this->file.' is not writable by the webserver')); - } $result = file_put_contents($this->file,serialize(array())); if($result === false){ throw new ConfigException(sprintf('file '.$this->file.' could not be written')); } } + else if(!is_writable ($this->file)){ + throw new ConfigException(sprintf('file '.$this->file.' is not writable by the webserver')); + } }