Backup and playlist render dummy methods fixed.

This commit is contained in:
tomash 2006-03-20 13:54:19 +00:00
parent 588de8d2ac
commit 2c7630c800

View file

@ -803,9 +803,10 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToFileOpen($sessid, $plid)
{
return PEAR::raiseError(
"GreenBox::renderPlaylistToFileOpen: not implemented"
);
$token = '123456789abcdeff';
$fakeFile = "{$this->accessDir}/$token.ogg";
file_put_contents($fakeFile, "fake renderred file");
return array('token'=>$token);
}
/**
@ -818,8 +819,15 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToFileCheck($token)
{
$fakeFile = "{$this->accessDir}/$token.ogg";
if($token != '123456789abcdeff' || !file_exists($fakeFile)){
return PEAR::raiseError(
"GreenBox::renderPlaylistToFileCheck: not implemented"
"GreenBox::renderPlaylistToFileCheck: invalid token ($token)"
);
}
return array(
'status'=> 'success',
'tmpfile' => $fakeFile,
);
}
@ -831,10 +839,15 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToFileClose($token)
{
if($token != '123456789abcdeff'){
return PEAR::raiseError(
"GreenBox::renderPlaylistToFileClose: not implemented"
"GreenBox::renderPlaylistToFileClose: invalid token"
);
}
$fakeFile = "{$this->accessDir}/$token.ogg";
unlink($fakeFile);
return TRUE;
}
/**
@ -846,9 +859,10 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToStorageOpen($sessid, $plid)
{
return PEAR::raiseError(
"GreenBox::renderPlaylistToStorageOpen: not implemented"
);
$token = '123456789abcdeff';
$fakeFile = "{$this->accessDir}/$token.ogg";
file_put_contents($fakeFile, "fake renderred file");
return array('token'=>$token);
}
/**
@ -861,8 +875,16 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToStorageCheck($token)
{
$fakeFile = "{$this->accessDir}/$token.ogg";
if($token != '123456789abcdeff' || !file_exists($fakeFile)){
return PEAR::raiseError(
"GreenBox::renderPlaylistToStorageCheck: not implemented"
"GreenBox::renderPlaylistToStorageCheck: invalid token ($token)"
);
}
unlink($fakeFile);
return array(
'status'=> 'success',
'gunid' => '0000000000010001',
);
}
@ -876,9 +898,10 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToRSSOpen($sessid, $plid)
{
return PEAR::raiseError(
"GreenBox::renderPlaylistToRSSOpen: not implemented"
);
$token = '123456789abcdeff';
$fakeFile = "{$this->accessDir}/$token.rss";
file_put_contents($fakeFile, "fake renderred file");
return array('token'=>$token);
}
/**
@ -891,8 +914,15 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToRSSCheck($token)
{
$fakeFile = "{$this->accessDir}/$token.rss";
if($token != '123456789abcdeff' || !file_exists($fakeFile)){
return PEAR::raiseError(
"GreenBox::renderPlaylistToRSSCheck: not implemented"
"LocStor::renderPlaylistToRSSCheck: invalid token ($token)"
);
}
return array(
'status'=> 'success',
'tmpfile' => $fakeFile,
);
}
@ -904,10 +934,15 @@ class GreenBox extends BasicStor{
*/
function renderPlaylistToRSSClose($token)
{
if($token != '123456789abcdeff'){
return PEAR::raiseError(
"GreenBox::renderPlaylistToRSSClose: not implemented"
"GreenBox::renderPlaylistToRSSClose: invalid token"
);
}
$fakeFile = "{$this->accessDir}/$token.rss";
unlink($fakeFile);
return TRUE;
}
/*================================================= storage admin methods */
@ -919,11 +954,12 @@ class GreenBox extends BasicStor{
* @param criteria : struct - see search criteria
* @return token : string - backup token
*/
function createBackupOpen($sessid, $criteria)
function createBackupOpen($sessid, $criteria='')
{
return PEAR::raiseError(
"GreenBox::createBackupOpen: not implemented"
);
$token = '123456789abcdeff';
$fakeFile = "{$this->accessDir}/$token.tar";
file_put_contents($fakeFile, "fake archive file");
return array('token'=>$token);
}
/**
@ -937,8 +973,16 @@ class GreenBox extends BasicStor{
*/
function createBackupCheck($token)
{
$fakeFile = "{$this->accessDir}/$token.tar";
if($token != '123456789abcdeff' || !file_exists($fakeFile)){
return PEAR::raiseError(
"GreenBox::createBackupCheck: not implemented"
"LocStor::createBackupCheck: invalid token ($token)"
);
}
return array(
'status'=> 'success',
'tmpfile' => $fakeFile,
'metafile' => '',
);
}
@ -950,10 +994,15 @@ class GreenBox extends BasicStor{
*/
function createBackupClose($token)
{
if($token != '123456789abcdeff'){
return PEAR::raiseError(
"GreenBox::createBackupClose: not implemented"
"LocStor::createBackupClose: invalid token"
);
}
$fakeFile = "{$this->accessDir}/$token.tar";
unlink($fakeFile);
return TRUE;
}
/* ============================================== methods for preferences */