From 3690760108aae348bd1f23dac51a3d029f8d5a66 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 16 Sep 2014 13:52:24 +0000 Subject: [PATCH] authzgroups : Better work in table creation (don't hang on first error when creating multiple times the tables) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1825 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authzgroups.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/authzgroups.php b/authzgroups.php index 11d0158..0b305af 100644 --- a/authzgroups.php +++ b/authzgroups.php @@ -196,10 +196,19 @@ class authzgroups if ($this->dbRight == null) throw new Exception (dgettext ("domframework", "DB for Right is not connected"), 500); - $this->dbObject->createTable (); - $this->dbGroup->createTable (); - $this->dbGroupMember->createTable (); - $this->dbRight->createTable (); + $tables = array ("Object", "Group", "GroupMember", "Right"); + foreach ($tables as $table) + { + try + { + $class= "db$table"; + $this->$class->createTable (); + } + catch (Exception $e) + { + echo $e->getMessage()."\n"; + } + } return TRUE; }