From 56f1593247852e109abf73746ce968d4b391e1f8 Mon Sep 17 00:00:00 2001 From: tomash Date: Mon, 9 Oct 2006 15:11:49 +0000 Subject: [PATCH] #1833 two error catcher added --- .../modules/storageServer/var/BasicStor.php | 21 +++++++++++++------ .../storageServer/var/install/install.php | 2 +- .../storageServer/var/install/uninstall.php | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/livesupport/src/modules/storageServer/var/BasicStor.php b/livesupport/src/modules/storageServer/var/BasicStor.php index 7a4dbf307..5475dfd6c 100644 --- a/livesupport/src/modules/storageServer/var/BasicStor.php +++ b/livesupport/src/modules/storageServer/var/BasicStor.php @@ -76,9 +76,10 @@ class BasicStor extends Alib { * @param config $config array from conf.php * @return class instance */ - function BasicStor(&$dbc, $config) + function BasicStor(&$dbc, $config, $install=FALSE) { parent::Alib($dbc, $config); + $this->dbc->setErrorHandling(PEAR_ERROR_RETURN); $this->config = $config; $this->filesTable = $config['tblNamePrefix'].'files'; $this->mdataTable = $config['tblNamePrefix'].'mdata'; @@ -87,11 +88,19 @@ class BasicStor extends Alib { $this->bufferDir = realpath($config['bufferDir']); $this->transDir = realpath($config['transDir']); $this->accessDir = realpath($config['accessDir']); - $this->dbc->setErrorHandling(PEAR_ERROR_RETURN); - $this->rootId = $this->getRootNode(); - $this->storId = $this->wd = - $this->getObjId('StorageRoot', $this->rootId); - $this->dbc->setErrorHandling(); + if(!$install){ + $this->rootId = $r = $this->getRootNode(); + if ($this->dbc->isError($r)){ + trigger_error("BasicStor: ". + $r->getMessage()." ".$r->getUserInfo(),E_USER_ERROR); + } + $this->storId = $this->wd = + $r = $this->getObjId('StorageRoot', $this->getRootNode()); + if ($this->dbc->isError($r)){ + trigger_error("BasicStor: ". + $r->getMessage()." ".$r->getUserInfo(),E_USER_ERROR); + } + } } diff --git a/livesupport/src/modules/storageServer/var/install/install.php b/livesupport/src/modules/storageServer/var/install/install.php index 724adf956..ea9369b7f 100644 --- a/livesupport/src/modules/storageServer/var/install/install.php +++ b/livesupport/src/modules/storageServer/var/install/install.php @@ -72,7 +72,7 @@ if(PEAR::isError($dbc)){ } $dbc->setFetchMode(DB_FETCHMODE_ASSOC); -$gb =& new GreenBox($dbc, $config); +$gb =& new GreenBox($dbc, $config, TRUE); $tr =& new Transport($gb); $pr =& new Prefs($gb); diff --git a/livesupport/src/modules/storageServer/var/install/uninstall.php b/livesupport/src/modules/storageServer/var/install/uninstall.php index 012738375..cfbec47f4 100644 --- a/livesupport/src/modules/storageServer/var/install/uninstall.php +++ b/livesupport/src/modules/storageServer/var/install/uninstall.php @@ -65,7 +65,7 @@ if(PEAR::isError($dbc)){ echo "#StorageServer uninstall:\n"; $dbc->setFetchMode(DB_FETCHMODE_ASSOC); -$gb = &new GreenBox($dbc, $config); +$gb = &new GreenBox($dbc, $config, TRUE); $tr =& new Transport($gb); $pr =& new Prefs($gb); $dbc->setErrorHandling(PEAR_ERROR_RETURN);