Code formatting

This commit is contained in:
paul 2006-12-08 04:33:35 +00:00
parent 55688910d5
commit f98af0ace0

View file

@ -307,6 +307,7 @@ class Transport
*/
function upload2Hub($gunid, $withContent=TRUE, $pars=array())
{
$this->trLog("upload2Hub start: ".strftime("%H:%M:%S"));
switch ($ftype = $this->gb->_getType($gunid)) {
case "audioclip":
case "webstream":
@ -344,6 +345,7 @@ class Transport
}
$this->startCronJobProcess($mdtrec->trtok);
break;
case "playlist":
$plid = $gunid;
require_once("Playlist.php");
@ -356,13 +358,17 @@ class Transport
return $fname;
}
if ($withContent) {
$this->trLog("upload2Hub exportPlaylistOpen BEGIN: ".strftime("%H:%M:%S"));
$res = $this->gb->bsExportPlaylistOpen($plid);
$this->trLog("upload2Hub exportPlaylistOpen END: ".strftime("%H:%M:%S"));
if (PEAR::isError($res)) {
return $res;
}
$tmpn = tempnam($this->transDir, 'plExport_');
$plfpath = "$tmpn.lspl";
$this->trLog("upload2Hub begin copy: ".strftime("%H:%M:%S"));
copy($res['fname'], $plfpath);
$this->trLog("upload2Hub end copy: ".strftime("%H:%M:%S"));
$res = $this->gb->bsExportPlaylistClose($res['token']);
if (PEAR::isError($res)) {
return $res;
@ -377,19 +383,16 @@ class Transport
$trtype = 'playlist';
}
$trec = $this->_uploadGeneralFileToHub($plfpath, $trtype,
array_merge(array('gunid'=>$plid,'fname'=>$fname,), $pars)
);
array_merge(array('gunid'=>$plid,'fname'=>$fname,), $pars));
if (PEAR::isError($trec)) {
return $trec;
}
break;
default:
return PEAR::raiseError(
"Transport::upload2Hub:".
" ftype not supported ($ftype)"
);
return PEAR::raiseError("Transport::upload2Hub: ftype not supported ($ftype)");
}
$this->startCronJobProcess($trec->trtok);
$this->trLog("upload2Hub end: ".strftime("%H:%M:%S"));
return $trec->trtok;
}
@ -412,22 +415,9 @@ class Transport
*/
function downloadFromHub($uid, $gunid, $withContent=TRUE, $pars=array())
{
# $this->trLog(var_export($gunid, TRUE));
$trtype = ($withContent ? 'playlistPkg' : 'unknown' );
$trec = TransportRecord::create($this, $trtype, 'down',
array_merge(array('gunid'=>$gunid, 'uid'=>$uid), $pars)
/* merged !???
array(
'trtok' => '123456789abcdef2',
),
array(
'trtok' => '123456789abcdef3',
),
array(
'trtok' => '123456789abcdef4',
),
*/
);
array_merge(array('gunid'=>$gunid, 'uid'=>$uid), $pars));
if (PEAR::isError($trec)) {
return $trec;
}
@ -464,7 +454,6 @@ class Transport
return $r;
}
$this->logoutFromArchive($r);
// ----------
$criteria['resultMode'] = $resultMode;
$localfile = tempnam($this->transDir, 'searchjob_');
@chmod($localfile, 0660);
@ -494,7 +483,6 @@ class Transport
if (PEAR::isError($trec)) {
return $trec;
}
//echo"<pre>";print_r($trec);echo "</pre>";
$row = $trec->row;
switch ($st = $trec->getState()) {
case "failed":