ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilFSStorageGroup Class Reference
+ Inheritance diagram for ilFSStorageGroup:
+ Collaboration diagram for ilFSStorageGroup:

Public Member Functions

 __construct ($a_container_id=0)
 Constructor. More...
 
 initMemberExportDirectory ()
 Init export directory and create it if it does not exist. More...
 
 getMemberExportDirectory ()
 Get path of export directory. More...
 
 addMemberExportFile ($a_data, $a_rel_name)
 Add new export file. More...
 
 getMemberExportFiles ()
 Get all member export files. More...
 
 getMemberExportFile ($a_name)
 
 deleteMemberExportFile ($a_export_name)
 Delete Member Export File. More...
 
- Public Member Functions inherited from ilFileSystemStorage
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor. More...
 
 getContainerId ()
 
 create ()
 Create directory. More...
 
 getAbsolutePath ()
 Get absolute path of storage directory. More...
 
 writeToFile ($a_data, $a_absolute_path)
 Write data to file. More...
 
 deleteFile ($a_abs_name)
 Delete file. More...
 
 deleteDirectory ($a_abs_name)
 Delete directory. More...
 
 delete ()
 Delete complete directory. More...
 
 copyFile ($a_from, $a_to)
 Copy files. More...
 
 appendToPath ($a_appendix)
 
 getStorageType ()
 
 getPath ()
 Get path. More...
 
 __construct ($a_storage_type, $a_path_conversion, $a_container_id)
 Constructor. More...
 
 create ()
 Create directory. More...
 
 getAbsolutePath ()
 Get absolute path of storage directory. More...
 
 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 STORAGE_SECURED = 3
 
const FACTOR = 100
 
const MAX_EXPONENT = 3
 
const SECURED_DIRECTORY = "sec"
 

Protected Member Functions

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

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. More...
 
static _copyDirectory ($a_source, $a_target)
 Copy directory and all contents. More...
 
static _createPathFromId ($a_container_id, $a_name)
 Create a path from an id: e.g 12345 will be converted to 12/34/<name>_5. More...
 
- 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

◆ __construct()

ilFSStorageGroup::__construct (   $a_container_id = 0)

Constructor.

public

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

References $log, and ilFileSystemStorage\STORAGE_DATA.

26  {
27  global $log;
28 
29  $this->log = $log;
30  parent::__construct(ilFileSystemStorage::STORAGE_DATA,true,$a_container_id);
31  }

Member Function Documentation

◆ addMemberExportFile()

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().

64  {
66  if(!$this->writeToFile($a_data,$this->getMemberExportDirectory().'/'.$a_rel_name))
67  {
68  $this->log->write('Cannot write to file: '.$this->getMemberExportDirectory().'/'.$a_rel_name);
69  return false;
70  }
71 
72  return true;
73 
74  }
getMemberExportDirectory()
Get path of export directory.
initMemberExportDirectory()
Init export directory and create it if it does not exist.
writeToFile($a_data, $a_absolute_path)
Write data to file.
+ Here is the call graph for this function:

◆ deleteMemberExportFile()

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().

133  {
134  return $this->deleteFile($this->getMemberExportDirectory().'/'.$a_export_name);
135  }
getMemberExportDirectory()
Get path of export directory.
deleteFile($a_abs_name)
Delete file.
+ Here is the call graph for this function:

◆ getMemberExportDirectory()

ilFSStorageGroup::getMemberExportDirectory ( )

Get path of export directory.

public

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

References ilFileSystemStorage\getAbsolutePath().

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

51  {
52  return $this->getAbsolutePath().'/'.self::MEMBER_EXPORT_DIR;
53  }
getAbsolutePath()
Get absolute path of storage directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberExportFile()

ilFSStorageGroup::getMemberExportFile (   $a_name)

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

References getMemberExportDirectory().

116  {
117  $file_name = $this->getMemberExportDirectory().'/'.$a_name;
118 
119  if(@file_exists($file_name))
120  {
121  return file_get_contents($file_name);
122  }
123  }
getMemberExportDirectory()
Get path of export directory.
+ Here is the call graph for this function:

◆ getMemberExportFiles()

ilFSStorageGroup::getMemberExportFiles ( )

Get all member export files.

public

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

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

83  {
84  if(!@is_dir($this->getMemberExportDirectory()))
85  {
86  return array();
87  }
88 
89  $files = array();
90  $dp = @opendir($this->getMemberExportDirectory());
91 
92  while($file = readdir($dp))
93  {
94  if(is_dir($file))
95  {
96  continue;
97  }
98 
99  if(preg_match("/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/",$file,$matches) and $matches[3] == $this->getContainerId())
100  {
101  $timest = $matches[1];
102  $file_info['name'] = $matches[0];
103  $file_info['timest'] = $matches[1];
104  $file_info['type'] = $matches[2];
105  $file_info['id'] = $matches[3];
106  $file_info['size'] = filesize($this->getMemberExportDirectory().'/'.$file);
107 
108  $files[$timest] = $file_info;
109  }
110  }
111  closedir($dp);
112  return $files ? $files : array();
113  }
$files
Definition: add-vimline.php:18
getMemberExportDirectory()
Get path of export directory.
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getPathPostfix()

ilFSStorageGroup::getPathPostfix ( )
protected

Implementation of abstract method.

protected

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

148  {
149  return 'grp';
150  }

◆ getPathPrefix()

ilFSStorageGroup::getPathPrefix ( )
protected

Implementation of abstract method.

protected

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

159  {
160  return 'ilGroup';
161  }

◆ initMemberExportDirectory()

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().

40  {
42  }
getMemberExportDirectory()
Get path of export directory.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $log

ilFSStorageGroup::$log
private

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

Referenced by __construct().

◆ MEMBER_EXPORT_DIR

const ilFSStorageGroup::MEMBER_EXPORT_DIR = 'memberExport'

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


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