diff options
| author | 2013-10-07 11:59:54 +0200 | |
|---|---|---|
| committer | 2013-10-07 11:59:54 +0200 | |
| commit | 9fcca8a7826981f55133e3a77521cf1724ec69b6 (patch) | |
| tree | be086470b2d628ba4a6bf7f668c30d12e2e82498 | |
| parent | 879e9fcd76f65107390bffa7d8c8999cb6c6a853 (diff) | |
Fix issue #157: message lors d'un PDOConnectionException
Le message est loggué dans le fichier qui va bien et un message est affiché
à l'écran : ### Application problem ### See logs files
| -rwxr-xr-x | lib/minz/FrontController.php | 2 | ||||
| -rwxr-xr-x | lib/minz/dao/Model_pdo.php | 2 | ||||
| -rwxr-xr-x | public/index.php | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/minz/FrontController.php b/lib/minz/FrontController.php index 489e3fa33..84e7a07e1 100755 --- a/lib/minz/FrontController.php +++ b/lib/minz/FrontController.php @@ -118,6 +118,6 @@ class FrontController { if ($txt == '') { $txt = 'See logs files'; } - exit ('### Application problem ###'."\n".$txt); + exit ('### Application problem ###'."\n".$txt); } } diff --git a/lib/minz/dao/Model_pdo.php b/lib/minz/dao/Model_pdo.php index 6efe5b30f..fa44038db 100755 --- a/lib/minz/dao/Model_pdo.php +++ b/lib/minz/dao/Model_pdo.php @@ -33,7 +33,7 @@ class Model_pdo { . ';charset=utf8'; $driver_options = array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' - ); + ); } elseif($type == 'sqlite') { $string = $type . ':/' . PUBLIC_PATH diff --git a/public/index.php b/public/index.php index 4e39d028e..64aabb609 100755 --- a/public/index.php +++ b/public/index.php @@ -38,7 +38,12 @@ if (file_exists (PUBLIC_PATH . '/install.php')) { require (APP_PATH . '/App_FrontController.php'); - $front_controller = new App_FrontController (); - $front_controller->init (); - $front_controller->run (); + try { + $front_controller = new App_FrontController (); + $front_controller->init (); + $front_controller->run (); + } catch (PDOConnectionException $e) { + Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + print '### Application problem ###'."\n".'See logs files'; + } } |
