Changes for:

http://bugs.campware.org/view.php?id=546
This commit is contained in:
tomas 2005-01-15 13:50:51 +00:00
parent 5a749c7977
commit 5776b42b12
3 changed files with 45 additions and 11 deletions

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ 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 $ 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"; include"../tests/sampleData.php";
$res = array(); $res = array();
foreach($sampleData as $k=>$it){ foreach($sampleData as $k=>$it){
list($media, $meta) = $it; switch($it['type']){
# $r = $this->putFile($rootHD, "file".($k+1), $media, $meta, $s); case"audioclip":
$media = $it['media'];
$xml = $it['xml'];
if(isset($it['gunid'])) $gunid = $it['gunid'];
else $gunid = '';
$r = $this->bsPutFile( $r = $this->bsPutFile(
$rootHD, basename($media), $media, $meta, '', 'audioclip' $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; } if(PEAR::isError($r)){ return $r; }
$res[] = $this->_gunidFromId($r); $res[] = $this->_gunidFromId($r);
} }

View File

@ -1,7 +1,25 @@
<? <?
$sampleData = array( $sampleData = array(
array('../tests/ex1.mp3', '../tests/mdata1.xml'), array(
array('../tests/ex2.ogg', '../tests/mdata2.xml'), 'type' => 'audioclip',
array('../tests/ex3.wav', '../tests/mdata3.xml') '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'
)
); );
?> ?>

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ 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 $ 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 success, returns a XML-RPC struct with single field:
* <ul> * <ul>
* <li> gunids : array - array with gunids of inserted files </li> * <li> gunids : array -
* array with gunids/playlisIds of inserted files </li>
* </ul> * </ul>
* *
* On errors, returns an XML-RPC error response. * On errors, returns an XML-RPC error response.