From 5776b42b1249bacc1154d84e4180283f30c29ba1 Mon Sep 17 00:00:00 2001 From: tomas Date: Sat, 15 Jan 2005 13:50:51 +0000 Subject: [PATCH] Changes for: http://bugs.campware.org/view.php?id=546 --- .../modules/storageServer/var/LocStor.php | 27 ++++++++++++++----- .../storageServer/var/tests/sampleData.php | 24 ++++++++++++++--- .../storageServer/var/xmlrpc/XR_LocStor.php | 5 ++-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/livesupport/modules/storageServer/var/LocStor.php b/livesupport/modules/storageServer/var/LocStor.php index 6159bb882..846249760 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.17 $ + Version : $Revision: 1.18 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $ ------------------------------------------------------------------------------*/ @@ -397,11 +397,26 @@ class LocStor extends GreenBox{ include"../tests/sampleData.php"; $res = array(); foreach($sampleData as $k=>$it){ - list($media, $meta) = $it; -# $r = $this->putFile($rootHD, "file".($k+1), $media, $meta, $s); - $r = $this->bsPutFile( - $rootHD, basename($media), $media, $meta, '', 'audioclip' - ); + 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' + ); + break; + case"playlist": + $xml = $it['xml']; + if(isset($it['gunid'])) $gunid = $it['gunid']; + else $gunid = ''; + $r = $this->bsPutFile( + $rootHD, basename($xml), '', $xml, $gunid, 'playlist' + ); + break; + } if(PEAR::isError($r)){ return $r; } $res[] = $this->_gunidFromId($r); } diff --git a/livesupport/modules/storageServer/var/tests/sampleData.php b/livesupport/modules/storageServer/var/tests/sampleData.php index b9140302e..7f5673f7c 100644 --- a/livesupport/modules/storageServer/var/tests/sampleData.php +++ b/livesupport/modules/storageServer/var/tests/sampleData.php @@ -1,7 +1,25 @@ 'audioclip', + 'media' => '../tests/ex1.mp3', + 'xml' => '../tests/mdata1.xml', + 'gunid' => '123456789abcdef1' + ), + array( + 'type' => 'audioclip', + 'media' => '../tests/ex2.ogg', + 'xml' => '../tests/mdata2.xml', + 'gunid' => '123456789abcdef2' + ), + array( + 'type' => 'audioclip', + 'media' => '../tests/ex3.wav', + 'xml' => '../tests/mdata3.xml' + ), + array( + 'type' => 'playlist', + 'xml' => '../tests/plist1.xml' + ) ); ?> diff --git a/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php b/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php index 88ec1bc84..07a601e3d 100644 --- a/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php +++ b/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.4 $ + Version : $Revision: 1.5 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $ ------------------------------------------------------------------------------*/ @@ -1188,7 +1188,8 @@ class XR_LocStor extends LocStor{ * * On success, returns a XML-RPC struct with single field: * * * On errors, returns an XML-RPC error response.