From f427014804b8537d4a14587b3735937d0fe852a5 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 19 Nov 2013 12:04:56 +0100 Subject: Message d'erreur si fichier conf innaccessible Voir #282 --- lib/minz/dao/Model_txt.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/minz/dao') diff --git a/lib/minz/dao/Model_txt.php b/lib/minz/dao/Model_txt.php index c9d5cfe77..aed653068 100755 --- a/lib/minz/dao/Model_txt.php +++ b/lib/minz/dao/Model_txt.php @@ -27,10 +27,17 @@ class Model_txt { */ public function __construct ($nameFile, $mode = 'a+') { $this->filename = $nameFile; + if (!file_exists($this->filename)) { + throw new FileNotExistException ( + $this->filename, + MinzException::WARNING + ); + } + $this->file = @fopen ($this->filename, $mode); if (!$this->file) { - throw new FileNotExistException ( + throw new PermissionDeniedException ( $this->filename, MinzException::WARNING ); -- cgit v1.2.3