This commit is contained in:
tomas 2005-01-25 23:56:35 +00:00
parent bda8edd856
commit 744c9619fc
23 changed files with 111 additions and 103 deletions

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/alib.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/alib.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -37,7 +37,7 @@ define('ALIBERR_NOTEXISTS', 31);
* authentication/authorization class * authentication/authorization class
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.8 $ * @version $Revision: 1.9 $
* @see Subjects * @see Subjects
* @see GreenBox * @see GreenBox
*/ */
@ -56,7 +56,7 @@ class Alib extends Subjects{
*/ */
function Alib(&$dbc, $config) function Alib(&$dbc, $config)
{ {
parent::Subjects(&$dbc, $config); parent::Subjects($dbc, $config);
$this->permTable = $config['tblNamePrefix'].'perms'; $this->permTable = $config['tblNamePrefix'].'perms';
$this->sessTable = $config['tblNamePrefix'].'sess'; $this->sessTable = $config['tblNamePrefix'].'sess';
} }

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/class.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/class.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -35,7 +35,7 @@ require_once "mtree.php";
* class for 'object classes' handling - i.e. groups of object in tree * class for 'object classes' handling - i.e. groups of object in tree
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.3 $ * @version $Revision: 1.4 $
* @see Mtree * @see Mtree
* @see Subj * @see Subj
*/ */
@ -51,7 +51,7 @@ class ObjClasses extends Mtree{
*/ */
function ObjClasses(&$dbc, $config) function ObjClasses(&$dbc, $config)
{ {
parent::MTree(&$dbc, $config); parent::MTree($dbc, $config);
$this->classTable = $config['tblNamePrefix'].'classes'; $this->classTable = $config['tblNamePrefix'].'classes';
$this->cmembTable = $config['tblNamePrefix'].'cmemb'; $this->cmembTable = $config['tblNamePrefix'].'cmemb';
} }

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/alib/var/subj.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/alib/var/subj.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -39,7 +39,7 @@ define('ALIBERR_BADSMEMB', 21);
* (allow adding users to groups or groups to groups) * (allow adding users to groups or groups to groups)
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.4 $ * @version $Revision: 1.5 $
* @see ObjClasses * @see ObjClasses
* @see Alib * @see Alib
*/ */
@ -55,7 +55,7 @@ class Subjects extends ObjClasses{
*/ */
function Subjects(&$dbc, $config) function Subjects(&$dbc, $config)
{ {
parent::ObjClasses(&$dbc, $config); parent::ObjClasses($dbc, $config);
$this->subjTable = $config['tblNamePrefix'].'subjs'; $this->subjTable = $config['tblNamePrefix'].'subjs';
$this->smembTable = $config['tblNamePrefix'].'smemb'; $this->smembTable = $config['tblNamePrefix'].'smemb';
} }

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/conf.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/conf.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -58,6 +58,7 @@ $config = array(
), ),
'tblNamePrefix' => 'as_', 'tblNamePrefix' => 'as_',
'authCookieName'=> 'assid', 'authCookieName'=> 'assid',
'StationPrefsGr'=> '',
'storageDir' => dirname(getcwd()).'/stor', 'storageDir' => dirname(getcwd()).'/stor',
'bufferDir' => dirname(getcwd()).'/stor/buffer', 'bufferDir' => dirname(getcwd()).'/stor/buffer',
'transDir' => dirname(getcwd()).'/trans', 'transDir' => dirname(getcwd()).'/trans',

View File

@ -20,6 +20,6 @@ function errCallBack($err)
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new GreenBox(&$dbc, $config); $gb = &new GreenBox($dbc, $config);
?> ?>

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/archiveServer/var/install/install.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/install/install.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -57,7 +57,7 @@ if(PEAR::isError($dbc)){
} }
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config); $gb = &new Archive($dbc, $config);
echo "# archiveServer step 2:\n# trying uninstall ...\n"; echo "# archiveServer step 2:\n# trying uninstall ...\n";
$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/install/uninstall.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/install/uninstall.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -54,7 +54,7 @@ if(PEAR::isError($dbc)){
echo "#ArchiveServer uninstall:\n"; echo "#ArchiveServer uninstall:\n";
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config); $gb = &new Archive($dbc, $config);
$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.1 $ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/xmlrpc/put.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/xmlrpc/put.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ require_once '../Archive.php';
PEAR::setErrorHandling(PEAR_ERROR_RETURN); PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config); $gb = &new Archive($dbc, $config);
function http_error($code, $err){ function http_error($code, $err){
header("HTTP/1.1 $code"); header("HTTP/1.1 $code");

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/xmlrpc/xrArchive.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/archiveServer/var/xmlrpc/xrArchive.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -72,7 +72,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$archive = &new XR_Archive(&$dbc, $config); $archive = &new XR_Archive($dbc, $config);
$methods = array( $methods = array(
'test' => 'Tests toupper and checks sessid, params: '. 'test' => 'Tests toupper and checks sessid, params: '.

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.24 $ Version : $Revision: 1.25 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $ 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 * Core of LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.24 $ * @version $Revision: 1.25 $
* @see Alib * @see Alib
*/ */
class BasicStor extends Alib{ class BasicStor extends Alib{
@ -75,7 +75,7 @@ class BasicStor extends Alib{
*/ */
function BasicStor(&$dbc, $config) function BasicStor(&$dbc, $config)
{ {
parent::Alib(&$dbc, $config); parent::Alib($dbc, $config);
$this->config = $config; $this->config = $config;
$this->filesTable = $config['tblNamePrefix'].'files'; $this->filesTable = $config['tblNamePrefix'].'files';
$this->mdataTable = $config['tblNamePrefix'].'mdata'; $this->mdataTable = $config['tblNamePrefix'].'mdata';
@ -123,7 +123,7 @@ class BasicStor extends Alib{
$name = "$fileName"; $name = "$fileName";
$id = $this->addObj($name , 'File', $parid); $id = $this->addObj($name , 'File', $parid);
$ac =& StoredFile::insert( $ac =& StoredFile::insert(
&$this, $id, $name, $mediaFileLP, $mdataFileLP, $mdataLoc, $this, $id, $name, $mediaFileLP, $mdataFileLP, $mdataLoc,
$gunid, $ftype $gunid, $ftype
); );
if(PEAR::isError($ac)){ if(PEAR::isError($ac)){
@ -147,7 +147,7 @@ class BasicStor extends Alib{
switch($this->getObjType($id)){ switch($this->getObjType($id)){
case"audioclip": case"audioclip":
case"playlist": case"playlist":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)){ if(PEAR::isError($ac)){
// catch nonerror exception: // catch nonerror exception:
//if($ac->getCode() != GBERR_FOBJNEX) //if($ac->getCode() != GBERR_FOBJNEX)
@ -362,7 +362,7 @@ class BasicStor extends Alib{
*/ */
function bsOpenDownload($id, $part='media') function bsOpenDownload($id, $part='media')
{ {
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
$gunid = $ac->gunid; $gunid = $ac->gunid;
switch($part){ switch($part){
@ -579,7 +579,7 @@ class BasicStor extends Alib{
*/ */
function bsReplaceMetadata($id, $mdata, $mdataLoc='file') function bsReplaceMetadata($id, $mdata, $mdataLoc='file')
{ {
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
return $ac->replaceMetaData($mdata, $mdataLoc); return $ac->replaceMetaData($mdata, $mdataLoc);
} }
@ -592,7 +592,7 @@ class BasicStor extends Alib{
*/ */
function bsGetMetadata($id) function bsGetMetadata($id)
{ {
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
return $ac->getMetaData(); return $ac->getMetaData();
} }
@ -607,7 +607,7 @@ class BasicStor extends Alib{
function bsGetMetadataValue($id, $category) function bsGetMetadataValue($id, $category)
{ {
require_once "DataEngine.php"; require_once "DataEngine.php";
$de =& new DataEngine(&$this); $de =& new DataEngine($this);
return $de->getMetadataValue($id, $category); return $de->getMetadataValue($id, $category);
} }
@ -645,7 +645,7 @@ class BasicStor extends Alib{
function bsLocalSearch($criteria, $limit=0, $offset=0) function bsLocalSearch($criteria, $limit=0, $offset=0)
{ {
require_once "DataEngine.php"; require_once "DataEngine.php";
$de =& new DataEngine(&$this); $de =& new DataEngine($this);
return $de->localSearch($criteria, $limit, $offset); return $de->localSearch($criteria, $limit, $offset);
} }
@ -665,7 +665,7 @@ class BasicStor extends Alib{
function bsBrowseCategory($category, $limit=0, $offset=0, $criteria=NULL) function bsBrowseCategory($category, $limit=0, $offset=0, $criteria=NULL)
{ {
require_once "DataEngine.php"; require_once "DataEngine.php";
$de =& new DataEngine(&$this); $de =& new DataEngine($this);
return $de->browseCategory($category, $limit, $offset, $criteria); return $de->browseCategory($category, $limit, $offset, $criteria);
} }
@ -705,7 +705,7 @@ class BasicStor extends Alib{
*/ */
function bsAnalyzeFile($id) function bsAnalyzeFile($id)
{ {
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
$ia = $ac->analyzeMediaFile(); $ia = $ac->analyzeMediaFile();
return $ia; return $ia;
@ -916,9 +916,9 @@ class BasicStor extends Alib{
switch($this->getObjType($id)){ switch($this->getObjType($id)){
case"audioclip": case"audioclip":
case"playlist": case"playlist":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
$ac2 =& StoredFile::copyOf(&$ac, $nid); $ac2 =& StoredFile::copyOf($ac, $nid);
$ac2->rename($this->getObjName($nid)); $ac2->rename($this->getObjName($nid));
break; break;
case"File": case"File":
@ -953,7 +953,7 @@ class BasicStor extends Alib{
switch($ot = $this->getObjType($id)){ switch($ot = $this->getObjType($id)){
case"audioclip": case"audioclip":
case"playlist": case"playlist":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall($this, $id);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if($ac->isEdited() && !$forced){ if($ac->isEdited() && !$forced){
return PEAR::raiseError( return PEAR::raiseError(
@ -1063,6 +1063,7 @@ class BasicStor extends Alib{
*/ */
function test() function test()
{ {
$this->test_log = '';
// if(PEAR::isError($p = parent::test())) return $p; // if(PEAR::isError($p = parent::test())) return $p;
$this->deleteData(); $this->deleteData();
$this->testData(); $this->testData();

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.25 $ Version : $Revision: 1.26 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -59,7 +59,7 @@ class LocStor extends BasicStor{
"LocStor.php: storeAudioClipOpen: Wrong gunid ($gunid)" "LocStor.php: storeAudioClipOpen: Wrong gunid ($gunid)"
); );
} }
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(!PEAR::isError($ac)){ if(!PEAR::isError($ac)){
// gunid exists - do replace // gunid exists - do replace
$oid = $ac->getId(); $oid = $ac->getId();
@ -85,7 +85,7 @@ class LocStor extends BasicStor{
$oid = $this->addObj($tmpFname , 'File', $parid); $oid = $this->addObj($tmpFname , 'File', $parid);
if(PEAR::isError($oid)) return $oid; if(PEAR::isError($oid)) return $oid;
$ac =& StoredFile::insert( $ac =& StoredFile::insert(
&$this, $oid, '', '', $metadata, 'string', $this, $oid, '', '', $metadata, 'string',
$gunid, $ftype $gunid, $ftype
); );
if(PEAR::isError($ac)){ if(PEAR::isError($ac)){
@ -113,7 +113,7 @@ class LocStor extends BasicStor{
*/ */
function storeAudioClipClose($sessid, $token) function storeAudioClipClose($sessid, $token)
{ {
$ac =& StoredFile::recallByToken(&$this, $token); $ac =& StoredFile::recallByToken($this, $token);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
$tmpFname = $this->bsClosePut($token); $tmpFname = $this->bsClosePut($token);
if(PEAR::isError($tmpFname)){ $ac->delete(); return $tmpFname; } if(PEAR::isError($tmpFname)){ $ac->delete(); return $tmpFname; }
@ -146,7 +146,7 @@ class LocStor extends BasicStor{
*/ */
function accessRawAudioData($sessid, $gunid) function accessRawAudioData($sessid, $gunid)
{ {
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if(($res = $this->_authorize('read', $ac->getId(), $sessid)) !== TRUE) if(($res = $this->_authorize('read', $ac->getId(), $sessid)) !== TRUE)
return $res; return $res;
@ -162,7 +162,7 @@ class LocStor extends BasicStor{
*/ */
function releaseRawAudioData($sessid, $token) function releaseRawAudioData($sessid, $token)
{ {
$ac =& StoredFile::recallByToken(&$this, $token); $ac =& StoredFile::recallByToken($this, $token);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
return $ac->releaseRawMediaData($token); return $ac->releaseRawMediaData($token);
} }
@ -248,7 +248,7 @@ class LocStor extends BasicStor{
*/ */
function getAudioClip($sessid, $gunid) function getAudioClip($sessid, $gunid)
{ {
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if(($res = $this->_authorize('read', $ac->getId(), $sessid)) !== TRUE) if(($res = $this->_authorize('read', $ac->getId(), $sessid)) !== TRUE)
return $res; return $res;
@ -369,7 +369,7 @@ class LocStor extends BasicStor{
{ {
$ex = $this->existsFile($sessid, $gunid, 'audioclip'); $ex = $this->existsFile($sessid, $gunid, 'audioclip');
if(!$ex) return FALSE; if(!$ex) return FALSE;
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
return $ac->exists(); return $ac->exists();
} }
@ -385,7 +385,7 @@ class LocStor extends BasicStor{
*/ */
function existsFile($sessid, $gunid, $ftype=NULL) function existsFile($sessid, $gunid, $ftype=NULL)
{ {
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)){ if(PEAR::isError($ac)){
// catch some exceptions // catch some exceptions
switch($ac->getCode()){ switch($ac->getCode()){
@ -411,7 +411,7 @@ class LocStor extends BasicStor{
*/ */
function deleteAudioClip($sessid, $gunid) function deleteAudioClip($sessid, $gunid)
{ {
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE) if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE)
return $res; return $res;
@ -430,7 +430,7 @@ class LocStor extends BasicStor{
*/ */
function updateAudioClipMetadata($sessid, $gunid, $metadata) function updateAudioClipMetadata($sessid, $gunid, $metadata)
{ {
$ac =& StoredFile::recallByGunid(&$this, $gunid); $ac =& StoredFile::recallByGunid($this, $gunid);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE) if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE)
return $res; return $res;
@ -507,7 +507,7 @@ class LocStor extends BasicStor{
return $res; return $res;
$oid = $this->addObj($tmpFname , 'File', $parid); $oid = $this->addObj($tmpFname , 'File', $parid);
if(PEAR::isError($oid)) return $oid; if(PEAR::isError($oid)) return $oid;
$ac =& StoredFile::insert(&$this, $oid, '', '', $ac =& StoredFile::insert($this, $oid, '', '',
'<?xml version="1.0" encoding="UTF-8"?><smil><body/></smil>', '<?xml version="1.0" encoding="UTF-8"?><smil><body/></smil>',
'string', $playlistId, 'playlist' 'string', $playlistId, 'playlist'
); );
@ -550,7 +550,7 @@ class LocStor extends BasicStor{
'LocStor.php: editPlaylist: playlist already edited' 'LocStor.php: editPlaylist: playlist already edited'
); );
} }
$ac =& StoredFile::recallByGunid(&$this, $playlistId); $ac =& StoredFile::recallByGunid($this, $playlistId);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
$id = $ac->getId(); $id = $ac->getId();
$res = $this->bsOpenDownload($id, 'metadata'); $res = $this->bsOpenDownload($id, 'metadata');
@ -571,7 +571,7 @@ class LocStor extends BasicStor{
function savePlaylist($sessid, $playlistToken, $newPlaylist) function savePlaylist($sessid, $playlistToken, $newPlaylist)
{ {
$playlistId = $this->bsCloseDownload($playlistToken, $part='metadata'); $playlistId = $this->bsCloseDownload($playlistToken, $part='metadata');
$ac =& StoredFile::recallByGunid(&$this, $playlistId); $ac =& StoredFile::recallByGunid($this, $playlistId);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
$res = $ac->replaceMetaData($newPlaylist, $mdataLoc='string'); $res = $ac->replaceMetaData($newPlaylist, $mdataLoc='string');
if(PEAR::isError($res)){ return $res; } if(PEAR::isError($res)){ return $res; }
@ -595,7 +595,7 @@ class LocStor extends BasicStor{
'LocStor.php: deletePlaylist: playlist not exists' 'LocStor.php: deletePlaylist: playlist not exists'
); );
} }
$ac =& StoredFile::recallByGunid(&$this, $playlistId); $ac =& StoredFile::recallByGunid($this, $playlistId);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE) if(($res = $this->_authorize('write', $ac->getId(), $sessid)) !== TRUE)
return $res; return $res;
@ -684,7 +684,7 @@ class LocStor extends BasicStor{
*/ */
function _isEdited($playlistId) function _isEdited($playlistId)
{ {
$ac =& StoredFile::recallByGunid(&$this, $playlistId); $ac =& StoredFile::recallByGunid($this, $playlistId);
return $ac->isEdited($playlistId); return $ac->isEdited($playlistId);
} }
@ -697,7 +697,7 @@ class LocStor extends BasicStor{
*/ */
function _setEditFlag($playlistId, $val=TRUE) function _setEditFlag($playlistId, $val=TRUE)
{ {
$ac =& StoredFile::recallByGunid(&$this, $playlistId); $ac =& StoredFile::recallByGunid($this, $playlistId);
$state = $ac->_getState(); $state = $ac->_getState();
if($val){ $ac->setState('edited'); } if($val){ $ac->setState('edited'); }
else{ $ac->setState('ready'); } else{ $ac->setState('ready'); }

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.13 $ Version : $Revision: 1.14 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -416,6 +416,7 @@ class MetaData{
$objns_sql = (is_null($objns) ? "NULL" : "'$objns'" ); $objns_sql = (is_null($objns) ? "NULL" : "'$objns'" );
$object_sql = (is_null($object)? "NULL" : "'$object'"); $object_sql = (is_null($object)? "NULL" : "'$object'");
$predicate = strtolower($predicate); $predicate = strtolower($predicate);
$id = NULL;
if($mode == 'update'){ if($mode == 'update'){
$cond = "gunid = x'{$this->gunid}'::bigint AND predns=$predns_sql $cond = "gunid = x'{$this->gunid}'::bigint AND predns=$predns_sql
AND predicate='$predicate'"; AND predicate='$predicate'";
@ -477,9 +478,9 @@ class MetaData{
// "MetaData::genXMLDoc: not exists ({$this->gunid})" // "MetaData::genXMLDoc: not exists ({$this->gunid})"
// ); // );
$nxn =& $domd->create_element('metadata'); $nxn =& $domd->create_element('metadata');
$domd->append_child(&$nxn); $domd->append_child($nxn);
}else{ }else{
$rr = $this->genXMLNode(&$domd, &$domd, $row); $rr = $this->genXMLNode($domd, $domd, $row);
if(PEAR::isError($rr)) return $rr; if(PEAR::isError($rr)) return $rr;
} }
//return preg_replace("|</([^>]*)>|", "</\\1>\n", $domd->dump_mem())."\n"; //return preg_replace("|</([^>]*)>|", "</\\1>\n", $domd->dump_mem())."\n";
@ -501,7 +502,7 @@ class MetaData{
}else{ }else{
$nxn =& $domd->create_attribute($row['predicate'], ''); $nxn =& $domd->create_attribute($row['predicate'], '');
} }
$xn->append_child(&$nxn); $xn->append_child($nxn);
$uri = $this->dbc->getOne(" $uri = $this->dbc->getOne("
SELECT object FROM {$this->mdataTable} SELECT object FROM {$this->mdataTable}
WHERE gunid=x'{$this->gunid}'::bigint AND predicate='_namespace' WHERE gunid=x'{$this->gunid}'::bigint AND predicate='_namespace'
@ -515,9 +516,9 @@ class MetaData{
} }
if($row['object'] != 'NULL'){ if($row['object'] != 'NULL'){
$tn =& $domd->create_text_node($row['object']); $tn =& $domd->create_text_node($row['object']);
$nxn->append_child(&$tn); $nxn->append_child($tn);
} }
$this->genXMLTree(&$domd, &$nxn, $row['id']); $this->genXMLTree($domd, $nxn, $row['id']);
} }
/** /**
@ -538,7 +539,7 @@ class MetaData{
"); ");
if(PEAR::isError($qh)) return $qh; if(PEAR::isError($qh)) return $qh;
while($row = $qh->fetchRow()){ while($row = $qh->fetchRow()){
$this->genXMLNode(&$domd, &$xn, $row); $this->genXMLNode($domd, $xn, $row);
} }
$qh->free(); $qh->free();
} }

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.18 $ Version : $Revision: 1.19 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -65,7 +65,7 @@ class StoredFile{
$this->resDir = $this->_getResDir($this->gunid); $this->resDir = $this->_getResDir($this->gunid);
$this->accessDir = $this->gb->accessDir; $this->accessDir = $this->gb->accessDir;
$this->rmd =& new RawMediaData($this->gunid, $this->resDir); $this->rmd =& new RawMediaData($this->gunid, $this->resDir);
$this->md =& new MetaData(&$gb, $this->gunid, $this->resDir); $this->md =& new MetaData($gb, $this->gunid, $this->resDir);
return $this->gunid; return $this->gunid;
} }
@ -87,7 +87,7 @@ class StoredFile{
$mediaFileLP='', $metadata='', $mdataLoc='file', $mediaFileLP='', $metadata='', $mdataLoc='file',
$gunid=NULL, $ftype=NULL) $gunid=NULL, $ftype=NULL)
{ {
$ac =& new StoredFile(&$gb, ($gunid ? $gunid : NULL)); $ac =& new StoredFile($gb, ($gunid ? $gunid : NULL));
$ac->name = $name; $ac->name = $name;
$ac->id = $oid; $ac->id = $oid;
$ac->mime = "unKnown"; $ac->mime = "unKnown";
@ -172,7 +172,7 @@ class StoredFile{
); );
} }
$gunid = StoredFile::_normalizeGunid($row['gunid']); $gunid = StoredFile::_normalizeGunid($row['gunid']);
$ac =& new StoredFile(&$gb, $gunid); $ac =& new StoredFile($gb, $gunid);
$ac->mime = $row['mime']; $ac->mime = $row['mime'];
$ac->name = $row['name']; $ac->name = $row['name'];
$ac->id = $row['id']; $ac->id = $row['id'];
@ -189,7 +189,7 @@ class StoredFile{
*/ */
function recallByGunid(&$gb, $gunid='') function recallByGunid(&$gb, $gunid='')
{ {
return StoredFile::recall(&$gb, '', $gunid); return StoredFile::recall($gb, '', $gunid);
} }
/** /**
@ -211,7 +211,7 @@ class StoredFile{
if(is_null($gunid)) return PEAR::raiseError( if(is_null($gunid)) return PEAR::raiseError(
"StoredFile::recallByToken: invalid token ($token)", GBERR_AOBJNEX); "StoredFile::recallByToken: invalid token ($token)", GBERR_AOBJNEX);
$gunid = StoredFile::_normalizeGunid($gunid); $gunid = StoredFile::_normalizeGunid($gunid);
return StoredFile::recall(&$gb, '', $gunid); return StoredFile::recall($gb, '', $gunid);
} }
/** /**
@ -223,7 +223,7 @@ class StoredFile{
function copyOf(&$src, $nid) function copyOf(&$src, $nid)
{ {
$ac =& StoredFile::insert( $ac =& StoredFile::insert(
&$src->gb, $nid, $src->name, $src->_getRealRADFname(), $src->gb, $nid, $src->name, $src->_getRealRADFname(),
'', '', NULL, $src->gb->_getType($src->gunid) '', '', NULL, $src->gb->_getType($src->gunid)
); );
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
@ -470,7 +470,7 @@ class StoredFile{
*/ */
function isEdited($playlistId=NULL) function isEdited($playlistId=NULL)
{ {
if(is_null($playlistId)) $playlistId = $this->playlistId; if(is_null($playlistId)) $playlistId = $this->gunid;
$state = $this->_getState($playlistId); $state = $this->_getState($playlistId);
if($state == 'edited'){ return TRUE; } if($state == 'edited'){ return TRUE; }
return FALSE; return FALSE;
@ -506,8 +506,9 @@ class StoredFile{
*/ */
function _createGunid() function _createGunid()
{ {
$ip = (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '');
$initString = $initString =
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport"; microtime().$ip.rand()."org.mdlf.livesupport";
$hash = md5($initString); $hash = md5($initString);
// non-negative int8 // non-negative int8
$hsd = substr($hash, 0, 1); $hsd = substr($hash, 0, 1);

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/Transport.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/Transport.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -223,7 +223,7 @@ class Transport{
$this->trLog("INIT UP id={$row['id']}, trtok={$row['trtok']}"); $this->trLog("INIT UP id={$row['id']}, trtok={$row['trtok']}");
switch($row['trtype']){ switch($row['trtype']){
case"audioclip": case"audioclip":
$ac =& StoredFile::recallByGunid(&$this->gb, $row['gunid']); $ac =& StoredFile::recallByGunid($this->gb, $row['gunid']);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
$fpath = $ac->_getRealRADFname(); $fpath = $ac->_getRealRADFname();
$fname = $ac->_getFileName(); $fname = $ac->_getFileName();
@ -261,7 +261,7 @@ class Transport{
); );
break; break;
case"playlist": case"playlist":
$ac =& StoredFile::recallByGunid(&$this->gb, $row['gunid']); $ac =& StoredFile::recallByGunid($this->gb, $row['gunid']);
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
$fname = $ac->_getFileName(); $fname = $ac->_getFileName();
$size = filesize($fpath); $size = filesize($fpath);
@ -671,7 +671,7 @@ class Transport{
$name = $row['fname']; $name = $row['fname'];
$this->trLog("FIN1 DOWN id={$row['id']}, trtok={$row['trtok']}". $this->trLog("FIN1 DOWN id={$row['id']}, trtok={$row['trtok']}".
"\n ".serialize($row)); "\n ".serialize($row));
$ac =& StoredFile::recallByGunid(&$this->gb, $row['gunid']); $ac =& StoredFile::recallByGunid($this->gb, $row['gunid']);
if(!PEAR::isError($ac)){ if(!PEAR::isError($ac)){
// gunid exists - do replace // gunid exists - do replace
$id = $ac->getId(); $id = $ac->getId();
@ -684,7 +684,7 @@ class Transport{
$id = $this->gb->addObj($name , 'File', $row['parid']); $id = $this->gb->addObj($name , 'File', $row['parid']);
if(PEAR::isError($id)) return $id; if(PEAR::isError($id)) return $id;
$ac =& StoredFile::insert( $ac =& StoredFile::insert(
&$this->gb, $id, $name, $row['localfile'], $mdata, 'string', $this->gb, $id, $name, $row['localfile'], $mdata, 'string',
$row['gunid'], 'audioclip' $row['gunid'], 'audioclip'
); );
if(PEAR::isError($ac)) return $ac; if(PEAR::isError($ac)) return $ac;
@ -806,8 +806,9 @@ class Transport{
*/ */
function _createTrtok() function _createTrtok()
{ {
$ip = (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '');
$initString = $initString =
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport"; microtime().$ip.rand()."org.mdlf.livesupport";
$hash = md5($initString); $hash = md5($initString);
$res = substr($hash, 0, 16); $res = substr($hash, 0, 16);
return $res; return $res;

View File

@ -9,8 +9,8 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new LocStor(&$dbc, $config); $gb = &new LocStor($dbc, $config);
$tr =& new Transport(&$dbc, &$gb, $config); $tr =& new Transport($dbc, $gb, $config);
$cnt = 1; $cnt = 1;
#$res = $gb->cronJob(); #$res = $gb->cronJob();

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.10 $ Version : $Revision: 1.11 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/install.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/install.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -59,9 +59,9 @@ if(PEAR::isError($dbc)){
} }
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb =& new GreenBox(&$dbc, $config); $gb =& new GreenBox($dbc, $config);
$tr =& new Transport(&$dbc, &$gb, $config); $tr =& new Transport($dbc, $gb, $config);
$pr =& new Prefs(&$gb); $pr =& new Prefs($gb);
echo "#StorageServer step 2:\n# trying uninstall ...\n"; echo "#StorageServer step 2:\n# trying uninstall ...\n";
$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/uninstall.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/uninstall.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -56,9 +56,9 @@ if(PEAR::isError($dbc)){
echo "#StorageServer uninstall:\n"; echo "#StorageServer uninstall:\n";
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new GreenBox(&$dbc, $config); $gb = &new GreenBox($dbc, $config);
$tr =& new Transport(&$dbc, &$gb, $config); $tr =& new Transport($dbc, $gb, $config);
$pr =& new Prefs(&$gb); $pr =& new Prefs($gb);
$dbc->setErrorHandling(PEAR_ERROR_RETURN); $dbc->setErrorHandling(PEAR_ERROR_RETURN);
echo "# Uninstall Prefs submodule"; echo "# Uninstall Prefs submodule";

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/tests/transTest.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/tests/transTest.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -38,8 +38,8 @@ require_once '../LocStor.php';
PEAR::setErrorHandling(PEAR_ERROR_RETURN); PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new LocStor(&$dbc, $config); $gb = &new LocStor($dbc, $config);
$tr = &new Transport(&$gb->dbc, &$gb, $gb->config); $tr = &new Transport($gb->dbc, $gb, $gb->config);
@unlink("{$tr->transDir}/log"); @unlink("{$tr->transDir}/log");
$gunid = 'a23456789abcdefa'; $gunid = 'a23456789abcdefa';

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.12 $ Version : $Revision: 1.13 $
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 $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -1317,7 +1317,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Prefs.php'; require_once '../../../storageServer/var/Prefs.php';
$pr =& new Prefs(&$this); $pr =& new Prefs($this);
$res = $pr->loadPref($r['sessid'], $r['key']); $res = $pr->loadPref($r['sessid'], $r['key']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1368,7 +1368,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Prefs.php'; require_once '../../../storageServer/var/Prefs.php';
$pr =& new Prefs(&$this); $pr =& new Prefs($this);
$res = $pr->savePref($r['sessid'], $r['key'], $r['value']); $res = $pr->savePref($r['sessid'], $r['key'], $r['value']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1418,7 +1418,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Prefs.php'; require_once '../../../storageServer/var/Prefs.php';
$pr =& new Prefs(&$this); $pr =& new Prefs($this);
$res = $pr->delPref($r['sessid'], $r['key']); $res = $pr->delPref($r['sessid'], $r['key']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1470,7 +1470,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Prefs.php'; require_once '../../../storageServer/var/Prefs.php';
$pr =& new Prefs(&$this); $pr =& new Prefs($this);
$res = $pr->loadGroupPref($r['sessid'], $r['group'], $r['key']); $res = $pr->loadGroupPref($r['sessid'], $r['group'], $r['key']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1526,7 +1526,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Prefs.php'; require_once '../../../storageServer/var/Prefs.php';
$pr =& new Prefs(&$this); $pr =& new Prefs($this);
$res = $pr->saveGroupPref($r['sessid'], $r['group'], $r['key'], $r['value']); $res = $pr->saveGroupPref($r['sessid'], $r['group'], $r['key'], $r['value']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1576,7 +1576,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Transport.php'; require_once '../../../storageServer/var/Transport.php';
$tr =& new Transport(&$this->dbc, &$this, $this->config); $tr =& new Transport($this->dbc, $this, $this->config);
$res = $tr->uploadToArchive($r['gunid'], $r['sessid']); $res = $tr->uploadToArchive($r['gunid'], $r['sessid']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1625,7 +1625,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Transport.php'; require_once '../../../storageServer/var/Transport.php';
$tr =& new Transport(&$this->dbc, &$this, $this->config); $tr =& new Transport($this->dbc, $this, $this->config);
$res = $tr->downloadFromArchive($r['gunid'], $r['sessid']); $res = $tr->downloadFromArchive($r['gunid'], $r['sessid']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());
@ -1682,7 +1682,7 @@ class XR_LocStor extends LocStor{
list($ok, $r) = $this->_xr_getPars($input); list($ok, $r) = $this->_xr_getPars($input);
if(!$ok) return $r; if(!$ok) return $r;
require_once '../../../storageServer/var/Transport.php'; require_once '../../../storageServer/var/Transport.php';
$tr =& new Transport(&$this->dbc, &$this, $this->config); $tr =& new Transport($this->dbc, $this, $this->config);
$res = $tr->getTransportInfo($r['trtok'], $r['sessid']); $res = $tr->getTransportInfo($r['trtok'], $r['sessid']);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
$ec0 = intval($res->getCode()); $ec0 = intval($res->getCode());

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/put.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/put.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ require_once '../LocStor.php';
PEAR::setErrorHandling(PEAR_ERROR_RETURN); PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new LocStor(&$dbc, $config); $gb = &new LocStor($dbc, $config);
function http_error($code, $err){ function http_error($code, $err){
header("HTTP/1.1 $code"); header("HTTP/1.1 $code");

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$locStor = &new LocStor(&$dbc, $config); $locStor = &new LocStor($dbc, $config);
function http_error($code, $err){ function http_error($code, $err){
header("HTTP/1.1 $code"); header("HTTP/1.1 $code");
@ -95,7 +95,7 @@ if(PEAR::isError($ex_pl)){
}else{ http_error(500, $ex_pl->getMessage()); } }else{ http_error(500, $ex_pl->getMessage()); }
} }
if(!$ex_ac && !$ex_pl){ http_error(404, "404 File not found"); } if(!$ex_ac && !$ex_pl){ http_error(404, "404 File not found"); }
$ac =& StoredFile::recallByGunid(&$locStor, $gunid); $ac =& StoredFile::recallByGunid($locStor, $gunid);
if(PEAR::isError($ac)){ http_error(500, $ac->getMessage()); } if(PEAR::isError($ac)){ http_error(500, $ac->getMessage()); }
if($ex_ac){ if($ex_ac){
$realFname = $ac->_getRealRADFname(); $realFname = $ac->_getRealRADFname();

View File

@ -23,7 +23,7 @@
# #
# #
# Author : $Author: tomas $ # Author : $Author: tomas $
# Version : $Revision: 1.19 $ # Version : $Revision: 1.20 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -293,6 +293,7 @@ logout() {
} }
searchTest() { searchTest() {
echo "#XMLRPC search test"
login login
storeAudioClip storeAudioClip
GUNID=$RGUNID GUNID=$RGUNID
@ -310,6 +311,8 @@ searchTest() {
fi fi
deleteAudioClip deleteAudioClip
logout logout
echo "#XMLRPC: search: OK."
echo ""
} }
preferenceTest(){ preferenceTest(){

View File

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.20 $ Version : $Revision: 1.21 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -73,7 +73,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE); $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC); $dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$locStor = &new XR_LocStor(&$dbc, $config); $locStor = &new XR_LocStor($dbc, $config);
$methods = array( $methods = array(
'test' => 'Tests toupper and checks sessid, params: '. 'test' => 'Tests toupper and checks sessid, params: '.