ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilFSStorageGroup Class Reference
+ Inheritance diagram for ilFSStorageGroup:
+ Collaboration diagram for ilFSStorageGroup:

Public Member Functions

 __construct ($a_container_id=0)
 Constructor.
 initMemberExportDirectory ()
 Init export directory and create it if it does not exist.
 getMemberExportDirectory ()
 Get path of export directory.
 addMemberExportFile ($a_data, $a_rel_name)
 Add new export file.
 getMemberExportFiles ()
 Get all member export files.
 getMemberExportFile ($a_name)
 deleteMemberExportFile ($a_export_name)
 Delete Member Export File.
- Public Member Functions inherited from ilFileSystemStorage
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor.
 getContainerId ()
 create ()
 Create directory.
 getAbsolutePath ()
 Get absolute path of storage directory.
 writeToFile ($a_data, $a_absolute_path)
 Write data to file.
 deleteFile ($a_abs_name)
 Delete file.
 deleteDirectory ($a_abs_name)
 Delete directory.
 delete ()
 Delete complete directory.
 copyFile ($a_from, $a_to)
 Copy files.
 appendToPath ($a_appendix)
 getStorageType ()
 getPath ()
 Get path.
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor.
 create ()
 Create directory.
 getAbsolutePath ()
 Get absolute path of storage directory.
 getShortPath ()
 rename ($from, $to)

Data Fields

const MEMBER_EXPORT_DIR = 'memberExport'
- Data Fields inherited from ilFileSystemStorage
const STORAGE_WEB = 1
const STORAGE_DATA = 2
const FACTOR = 100
const MAX_EXPONENT = 3

Protected Member Functions

 getPathPostfix ()
 Implementation of abstract method.
 getPathPrefix ()
 Implementation of abstract method.
- Protected Member Functions inherited from ilFileSystemStorage
 init ()
 Read path info.

Private Attributes

 $log

Additional Inherited Members

- Static Public Member Functions inherited from ilFileSystemStorage
static _createPathFromId ($a_container_id, $a_name)
 Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5.
 _copyDirectory ($a_source, $a_target)
 Copy directory and all contents.
static _createPathFromId ($a_container_id, $a_name)
 Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5.
- Protected Attributes inherited from ilFileSystemStorage
 $path

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilFSStorageGroup.php.

Constructor & Destructor Documentation

ilFSStorageGroup::__construct (   $a_container_id = 0)

Constructor.

public

Definition at line 25 of file class.ilFSStorageGroup.php.

References $log, and ilFileSystemStorage\STORAGE_DATA.

{
global $log;
$this->log = $log;
}

Member Function Documentation

ilFSStorageGroup::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

public

Parameters
stringdata
stringfilename

Definition at line 63 of file class.ilFSStorageGroup.php.

References getMemberExportDirectory(), initMemberExportDirectory(), and ilFileSystemStorage\writeToFile().

{
if(!$this->writeToFile($a_data,$this->getMemberExportDirectory().'/'.$a_rel_name))
{
$this->log->write('Cannot write to file: '.$this->getMemberExportDirectory().'/'.$a_rel_name);
return false;
}
return true;
}

+ Here is the call graph for this function:

ilFSStorageGroup::deleteMemberExportFile (   $a_export_name)

Delete Member Export File.

public

Parameters

Definition at line 132 of file class.ilFSStorageGroup.php.

References ilFileSystemStorage\deleteFile(), and getMemberExportDirectory().

{
return $this->deleteFile($this->getMemberExportDirectory().'/'.$a_export_name);
}

+ Here is the call graph for this function:

ilFSStorageGroup::getMemberExportDirectory ( )

Get path of export directory.

public

Definition at line 50 of file class.ilFSStorageGroup.php.

References ilFileSystemStorage\getAbsolutePath(), and MEMBER_EXPORT_DIR.

Referenced by addMemberExportFile(), deleteMemberExportFile(), getMemberExportFile(), getMemberExportFiles(), and initMemberExportDirectory().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilFSStorageGroup::getMemberExportFile (   $a_name)

Definition at line 115 of file class.ilFSStorageGroup.php.

References getMemberExportDirectory().

{
$file_name = $this->getMemberExportDirectory().'/'.$a_name;
if(@file_exists($file_name))
{
return file_get_contents($file_name);
}
}

+ Here is the call graph for this function:

ilFSStorageGroup::getMemberExportFiles ( )

Get all member export files.

public

Definition at line 82 of file class.ilFSStorageGroup.php.

References $file, ilFileSystemStorage\getContainerId(), and getMemberExportDirectory().

{
if(!@is_dir($this->getMemberExportDirectory()))
{
return array();
}
$files = array();
$dp = @opendir($this->getMemberExportDirectory());
while($file = readdir($dp))
{
if(is_dir($file))
{
continue;
}
if(preg_match("/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/",$file,$matches) and $matches[3] == $this->getContainerId())
{
$timest = $matches[1];
$file_info['name'] = $matches[0];
$file_info['timest'] = $matches[1];
$file_info['type'] = $matches[2];
$file_info['id'] = $matches[3];
$file_info['size'] = filesize($this->getMemberExportDirectory().'/'.$file);
$files[$timest] = $file_info;
}
}
closedir($dp);
return $files ? $files : array();
}

+ Here is the call graph for this function:

ilFSStorageGroup::getPathPostfix ( )
protected

Implementation of abstract method.

protected

Reimplemented from ilFileSystemStorage.

Definition at line 147 of file class.ilFSStorageGroup.php.

{
return 'grp';
}
ilFSStorageGroup::getPathPrefix ( )
protected

Implementation of abstract method.

protected

Reimplemented from ilFileSystemStorage.

Definition at line 158 of file class.ilFSStorageGroup.php.

{
return 'ilGroup';
}
ilFSStorageGroup::initMemberExportDirectory ( )

Init export directory and create it if it does not exist.

public

Definition at line 39 of file class.ilFSStorageGroup.php.

References getMemberExportDirectory(), and ilUtil\makeDirParents().

Referenced by addMemberExportFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilFSStorageGroup::$log
private

Definition at line 18 of file class.ilFSStorageGroup.php.

Referenced by __construct().

const ilFSStorageGroup::MEMBER_EXPORT_DIR = 'memberExport'

Definition at line 16 of file class.ilFSStorageGroup.php.

Referenced by getMemberExportDirectory().


The documentation for this class was generated from the following file: