From 7fa94a3d5b366ff20cfc6ac162bd8075352ddda9 Mon Sep 17 00:00:00 2001 From: tomas Date: Fri, 18 Feb 2005 02:55:35 +0000 Subject: [PATCH] resetStorage method moved to BasicStor. --- .../modules/storageServer/var/BasicStor.php | 48 ++++++++++++++++++- .../modules/storageServer/var/LocStor.php | 46 +----------------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/livesupport/modules/storageServer/var/BasicStor.php b/livesupport/modules/storageServer/var/BasicStor.php index fb073094a..e179ed0b7 100644 --- a/livesupport/modules/storageServer/var/BasicStor.php +++ b/livesupport/modules/storageServer/var/BasicStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.29 $ + Version : $Revision: 1.30 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $ ------------------------------------------------------------------------------*/ @@ -52,7 +52,7 @@ require_once "Transport.php"; * Core of LiveSupport file storage module * * @author $Author: tomas $ - * @version $Revision: 1.29 $ + * @version $Revision: 1.30 $ * @see Alib */ class BasicStor extends Alib{ @@ -1118,6 +1118,50 @@ class BasicStor extends Alib{ } /* =============================================== test and debug methods */ + /** + * Reset storageServer for debugging. + * + * @param input string + */ + function resetStorage($input='') + { + $this->deleteData(); + if(!$this->config['isArchive']){ + $tr =& new Transport($this->dbc, $this, $this->config); + $tr->resetData(); + } + $rootHD = $this->getObjId('root', $this->storId); + include"../tests/sampleData.php"; + $res = array('audioclips'=>array(), 'playlists'=>array()); + foreach($sampleData as $k=>$it){ + switch($it['type']){ + case"audioclip": + $media = $it['media']; + $xml = $it['xml']; + if(isset($it['gunid'])) $gunid = $it['gunid']; + else $gunid = ''; + $r = $this->bsPutFile( + $rootHD, basename($media), + $media, $xml, $gunid, 'audioclip' + ); + if(PEAR::isError($r)){ return $r; } + $res['audioclips'][] = $this->_gunidFromId($r); + break; + case"playlist": + $xml = $it['xml']; + if(isset($it['gunid'])) $gunid = $it['gunid']; + else $gunid = ''; + $r = $this->bsPutFile( + $rootHD, basename($xml), '', $xml, $gunid, 'playlist' + ); + if(PEAR::isError($r)){ return $r; } + $res['playlists'][] = $this->_gunidFromId($r); + break; + } + } + return $res; + } + /** * dump * diff --git a/livesupport/modules/storageServer/var/LocStor.php b/livesupport/modules/storageServer/var/LocStor.php index e623391fc..5588e9a62 100644 --- a/livesupport/modules/storageServer/var/LocStor.php +++ b/livesupport/modules/storageServer/var/LocStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.31 $ + Version : $Revision: 1.32 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $ ------------------------------------------------------------------------------*/ @@ -457,50 +457,6 @@ class LocStor extends BasicStor{ return $ac->replaceMetaData($metadata, 'string'); } - /** - * Reset storageServer for debugging. - * - * @param input string - */ - function resetStorage($input='') - { - $this->deleteData(); - if(!$this->config['isArchive']){ - $tr =& new Transport($this->dbc, $this, $this->config); - $tr->resetData(); - } - $rootHD = $this->getObjId('root', $this->storId); - include"../tests/sampleData.php"; - $res = array('audioclips'=>array(), 'playlists'=>array()); - foreach($sampleData as $k=>$it){ - switch($it['type']){ - case"audioclip": - $media = $it['media']; - $xml = $it['xml']; - if(isset($it['gunid'])) $gunid = $it['gunid']; - else $gunid = ''; - $r = $this->bsPutFile( - $rootHD, basename($media), - $media, $xml, $gunid, 'audioclip' - ); - if(PEAR::isError($r)){ return $r; } - $res['audioclips'][] = $this->_gunidFromId($r); - break; - case"playlist": - $xml = $it['xml']; - if(isset($it['gunid'])) $gunid = $it['gunid']; - else $gunid = ''; - $r = $this->bsPutFile( - $rootHD, basename($xml), '', $xml, $gunid, 'playlist' - ); - if(PEAR::isError($r)){ return $r; } - $res['playlists'][] = $this->_gunidFromId($r); - break; - } - } - return $res; - } - /*====================================================== playlist methods */ /** * Create a new empty playlist.