Added public/private/protected/static to functions

This commit is contained in:
paul 2006-12-08 04:32:12 +00:00
parent 8dd2119496
commit 482d0052b3

View file

@ -124,7 +124,7 @@ class Backup
* hasharray with field: * hasharray with field:
* token string: backup token * token string: backup token
*/ */
function openBackup($sessid, $criteria='') public function openBackup($sessid, $criteria='')
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." openBackup - sessid:$sessid\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." openBackup - sessid:$sessid\n");
@ -188,7 +188,7 @@ class Backup
* url : string - access url * url : string - access url
* tmpfile : string - access filename * tmpfile : string - access filename
*/ */
function checkBackup($token) public function checkBackup($token)
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." checkBackup - token:$token\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." checkBackup - token:$token\n");
@ -220,7 +220,7 @@ class Backup
* @param unknown $token * @param unknown $token
* @return boolean * @return boolean
*/ */
function closeBackup($token) public function closeBackup($token)
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." closeBackup - token:$token\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." closeBackup - token:$token\n");
@ -249,7 +249,7 @@ class Backup
* token : stirng - backup token * token : stirng - backup token
* url : string - access url * url : string - access url
*/ */
function listBackups($stat='') public function listBackups($stat='')
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." listBackups - stat:$stat\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." listBackups - stat:$stat\n");
@ -268,11 +268,11 @@ class Backup
/** /**
* Aet the ids from searchResult * Set the ids from searchResult
* *
* @param array $searchResult : array of gunids * @param array $searchResult : array of gunids
*/ */
function setIDs($searchResult) private function setIDs($searchResult)
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." setIDs\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." setIDs\n");
@ -290,7 +290,7 @@ class Backup
* Set the filenames from ids. * Set the filenames from ids.
* *
*/ */
function setFilenames() private function setFilenames()
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." setFilenames\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." setFilenames\n");
@ -298,7 +298,7 @@ class Backup
if (is_array($this->ids)) { if (is_array($this->ids)) {
foreach ($this->ids as $i=>$item) { foreach ($this->ids as $i=>$item) {
$gunid = $item['gunid']; $gunid = $item['gunid'];
# get a stored file object of this gunid // get a stored file object of this gunid
$sf = StoredFile::recallByGunid($this->gb, $gunid); $sf = StoredFile::recallByGunid($this->gb, $gunid);
if (PEAR::isError($sf)) { if (PEAR::isError($sf)) {
return $sf; return $sf;
@ -308,10 +308,10 @@ class Backup
$this->addLogItem("-E- ".date("Ymd-H:i:s")." setFilenames - authorize gunid:$gunid\n"); $this->addLogItem("-E- ".date("Ymd-H:i:s")." setFilenames - authorize gunid:$gunid\n");
return PEAR::raiseError('Backup::setFilenames : Authorize ... error.'); return PEAR::raiseError('Backup::setFilenames : Authorize ... error.');
} }
# if the file is a playlist then it have only meta file // if the file is a playlist then it have only meta file
if (strtolower($sf->md->format)!='playlist') { if (strtolower($sf->md->format)!='playlist') {
$this->filenames[] = array( $this->filenames[] = array(
'filename' => $sf->_getRealRADFname(), # get real filename of raw media data 'filename' => $sf->_getRealRADFname(), // get real filename of raw media data
'format' => $sf->md->format 'format' => $sf->md->format
); );
} }
@ -335,7 +335,7 @@ class Backup
* Create the tarball - call the shell script * Create the tarball - call the shell script
* *
*/ */
function doIt() private function doIt()
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." doIt\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." doIt\n");
@ -357,7 +357,7 @@ class Backup
* Copy the real files into the tmp dirs to tar they. * Copy the real files into the tmp dirs to tar they.
* *
*/ */
function copyAllFiles() private function copyAllFiles()
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." copyAllFiles\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." copyAllFiles\n");
@ -386,7 +386,7 @@ class Backup
* Figure out the enviroment to the backup * Figure out the enviroment to the backup
* *
*/ */
function setEnviroment($createDir=false) private function setEnviroment($createDir=false)
{ {
if ($this->loglevel=='debug') { if ($this->loglevel=='debug') {
$this->addLogItem("-I- ".date("Ymd-H:i:s")." setEnviroment - createDirs:$createDir\n"); $this->addLogItem("-I- ".date("Ymd-H:i:s")." setEnviroment - createDirs:$createDir\n");
@ -437,7 +437,7 @@ class Backup
* Generate a new token. * Generate a new token.
* @return void * @return void
*/ */
function genToken() private function genToken()
{ {
$acc = $this->gb->bsAccess($this->tmpFile, BACKUP_EXT, null, ACCESS_TYPE); $acc = $this->gb->bsAccess($this->tmpFile, BACKUP_EXT, null, ACCESS_TYPE);
if ($this->gb->dbc->isError($acc)) { if ($this->gb->dbc->isError($acc)) {
@ -453,12 +453,11 @@ class Backup
* @param string $item * @param string $item
* the new row of log file * the new row of log file
*/ */
function addLogItem($item) private function addLogItem($item)
{ {
$f = fopen ($this->logFile,'a'); $f = fopen($this->logFile,'a');
fwrite($f,$item); fwrite($f,$item);
fclose($f); fclose($f);
//echo file_get_contents($this->logFile)."<BR><BR>\n\n";
} }
@ -468,7 +467,7 @@ class Backup
* @param string $dirname * @param string $dirname
* path of dir. * path of dir.
*/ */
function rRmDir($dirname) private static function rRmDir($dirname)
{ {
if (is_dir($dirname)) { if (is_dir($dirname)) {
$dir_handle = opendir($dirname); $dir_handle = opendir($dirname);