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 $
Version : $Revision: 1.8 $
Version : $Revision: 1.9 $
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
*
* @author $Author: tomas $
* @version $Revision: 1.8 $
* @version $Revision: 1.9 $
* @see Subjects
* @see GreenBox
*/
@ -56,7 +56,7 @@ class Alib extends Subjects{
*/
function Alib(&$dbc, $config)
{
parent::Subjects(&$dbc, $config);
parent::Subjects($dbc, $config);
$this->permTable = $config['tblNamePrefix'].'perms';
$this->sessTable = $config['tblNamePrefix'].'sess';
}

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -35,7 +35,7 @@ require_once "mtree.php";
* class for 'object classes' handling - i.e. groups of object in tree
*
* @author $Author: tomas $
* @version $Revision: 1.3 $
* @version $Revision: 1.4 $
* @see Mtree
* @see Subj
*/
@ -51,7 +51,7 @@ class ObjClasses extends Mtree{
*/
function ObjClasses(&$dbc, $config)
{
parent::MTree(&$dbc, $config);
parent::MTree($dbc, $config);
$this->classTable = $config['tblNamePrefix'].'classes';
$this->cmembTable = $config['tblNamePrefix'].'cmemb';
}

View File

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

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -58,6 +58,7 @@ $config = array(
),
'tblNamePrefix' => 'as_',
'authCookieName'=> 'assid',
'StationPrefsGr'=> '',
'storageDir' => dirname(getcwd()).'/stor',
'bufferDir' => dirname(getcwd()).'/stor/buffer',
'transDir' => dirname(getcwd()).'/trans',

View File

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

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -57,7 +57,7 @@ if(PEAR::isError($dbc)){
}
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config);
$gb = &new Archive($dbc, $config);
echo "# archiveServer step 2:\n# trying uninstall ...\n";
$dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -54,7 +54,7 @@ if(PEAR::isError($dbc)){
echo "#ArchiveServer uninstall:\n";
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config);
$gb = &new Archive($dbc, $config);
$dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ require_once '../Archive.php';
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new Archive(&$dbc, $config);
$gb = &new Archive($dbc, $config);
function http_error($code, $err){
header("HTTP/1.1 $code");

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -72,7 +72,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$archive = &new XR_Archive(&$dbc, $config);
$archive = &new XR_Archive($dbc, $config);
$methods = array(
'test' => 'Tests toupper and checks sessid, params: '.

View File

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

View File

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

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -416,6 +416,7 @@ class MetaData{
$objns_sql = (is_null($objns) ? "NULL" : "'$objns'" );
$object_sql = (is_null($object)? "NULL" : "'$object'");
$predicate = strtolower($predicate);
$id = NULL;
if($mode == 'update'){
$cond = "gunid = x'{$this->gunid}'::bigint AND predns=$predns_sql
AND predicate='$predicate'";
@ -477,9 +478,9 @@ class MetaData{
// "MetaData::genXMLDoc: not exists ({$this->gunid})"
// );
$nxn =& $domd->create_element('metadata');
$domd->append_child(&$nxn);
$domd->append_child($nxn);
}else{
$rr = $this->genXMLNode(&$domd, &$domd, $row);
$rr = $this->genXMLNode($domd, $domd, $row);
if(PEAR::isError($rr)) return $rr;
}
//return preg_replace("|</([^>]*)>|", "</\\1>\n", $domd->dump_mem())."\n";
@ -501,7 +502,7 @@ class MetaData{
}else{
$nxn =& $domd->create_attribute($row['predicate'], '');
}
$xn->append_child(&$nxn);
$xn->append_child($nxn);
$uri = $this->dbc->getOne("
SELECT object FROM {$this->mdataTable}
WHERE gunid=x'{$this->gunid}'::bigint AND predicate='_namespace'
@ -515,9 +516,9 @@ class MetaData{
}
if($row['object'] != 'NULL'){
$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;
while($row = $qh->fetchRow()){
$this->genXMLNode(&$domd, &$xn, $row);
$this->genXMLNode($domd, $xn, $row);
}
$qh->free();
}

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -65,7 +65,7 @@ class StoredFile{
$this->resDir = $this->_getResDir($this->gunid);
$this->accessDir = $this->gb->accessDir;
$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;
}
@ -87,7 +87,7 @@ class StoredFile{
$mediaFileLP='', $metadata='', $mdataLoc='file',
$gunid=NULL, $ftype=NULL)
{
$ac =& new StoredFile(&$gb, ($gunid ? $gunid : NULL));
$ac =& new StoredFile($gb, ($gunid ? $gunid : NULL));
$ac->name = $name;
$ac->id = $oid;
$ac->mime = "unKnown";
@ -172,7 +172,7 @@ class StoredFile{
);
}
$gunid = StoredFile::_normalizeGunid($row['gunid']);
$ac =& new StoredFile(&$gb, $gunid);
$ac =& new StoredFile($gb, $gunid);
$ac->mime = $row['mime'];
$ac->name = $row['name'];
$ac->id = $row['id'];
@ -189,7 +189,7 @@ class StoredFile{
*/
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(
"StoredFile::recallByToken: invalid token ($token)", GBERR_AOBJNEX);
$gunid = StoredFile::_normalizeGunid($gunid);
return StoredFile::recall(&$gb, '', $gunid);
return StoredFile::recall($gb, '', $gunid);
}
/**
@ -223,7 +223,7 @@ class StoredFile{
function copyOf(&$src, $nid)
{
$ac =& StoredFile::insert(
&$src->gb, $nid, $src->name, $src->_getRealRADFname(),
$src->gb, $nid, $src->name, $src->_getRealRADFname(),
'', '', NULL, $src->gb->_getType($src->gunid)
);
if(PEAR::isError($ac)) return $ac;
@ -470,7 +470,7 @@ class StoredFile{
*/
function isEdited($playlistId=NULL)
{
if(is_null($playlistId)) $playlistId = $this->playlistId;
if(is_null($playlistId)) $playlistId = $this->gunid;
$state = $this->_getState($playlistId);
if($state == 'edited'){ return TRUE; }
return FALSE;
@ -506,8 +506,9 @@ class StoredFile{
*/
function _createGunid()
{
$ip = (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '');
$initString =
microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport";
microtime().$ip.rand()."org.mdlf.livesupport";
$hash = md5($initString);
// non-negative int8
$hsd = substr($hash, 0, 1);

View File

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

View File

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

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -59,9 +59,9 @@ if(PEAR::isError($dbc)){
}
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb =& new GreenBox(&$dbc, $config);
$tr =& new Transport(&$dbc, &$gb, $config);
$pr =& new Prefs(&$gb);
$gb =& new GreenBox($dbc, $config);
$tr =& new Transport($dbc, $gb, $config);
$pr =& new Prefs($gb);
echo "#StorageServer step 2:\n# trying uninstall ...\n";
$dbc->setErrorHandling(PEAR_ERROR_RETURN);

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -56,9 +56,9 @@ if(PEAR::isError($dbc)){
echo "#StorageServer uninstall:\n";
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new GreenBox(&$dbc, $config);
$tr =& new Transport(&$dbc, &$gb, $config);
$pr =& new Prefs(&$gb);
$gb = &new GreenBox($dbc, $config);
$tr =& new Transport($dbc, $gb, $config);
$pr =& new Prefs($gb);
$dbc->setErrorHandling(PEAR_ERROR_RETURN);
echo "# Uninstall Prefs submodule";

View File

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

View File

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

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ require_once '../LocStor.php';
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new LocStor(&$dbc, $config);
$gb = &new LocStor($dbc, $config);
function http_error($code, $err){
header("HTTP/1.1 $code");

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -62,7 +62,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$locStor = &new LocStor(&$dbc, $config);
$locStor = &new LocStor($dbc, $config);
function http_error($code, $err){
header("HTTP/1.1 $code");
@ -95,7 +95,7 @@ if(PEAR::isError($ex_pl)){
}else{ http_error(500, $ex_pl->getMessage()); }
}
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($ex_ac){
$realFname = $ac->_getRealRADFname();

View File

@ -23,7 +23,7 @@
#
#
# 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 $
#-------------------------------------------------------------------------------
@ -293,6 +293,7 @@ logout() {
}
searchTest() {
echo "#XMLRPC search test"
login
storeAudioClip
GUNID=$RGUNID
@ -310,6 +311,8 @@ searchTest() {
fi
deleteAudioClip
logout
echo "#XMLRPC: search: OK."
echo ""
}
preferenceTest(){

View File

@ -23,7 +23,7 @@
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 $
------------------------------------------------------------------------------*/
@ -73,7 +73,7 @@ PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$locStor = &new XR_LocStor(&$dbc, $config);
$locStor = &new XR_LocStor($dbc, $config);
$methods = array(
'test' => 'Tests toupper and checks sessid, params: '.