#1833 two error catcher added

This commit is contained in:
tomash 2006-10-09 15:11:49 +00:00
parent 15ed807a23
commit 56f1593247
3 changed files with 17 additions and 8 deletions

View File

@ -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);
}
}
}

View File

@ -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);

View File

@ -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);