ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, $log, and ilFileSystemStorage\STORAGE_DATA.

26  {
27  global $DIC;
28 
29  $log = $DIC['log'];
30 
31  $this->log = $log;
32  parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $a_container_id);
33  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addMemberExportFile()

ilFSStorageGroup::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

public

Parameters
stringdata
stringfilename

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

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

66  {
68  if (!$this->writeToFile($a_data, $this->getMemberExportDirectory() . '/' . $a_rel_name)) {
69  $this->log->write('Cannot write to file: ' . $this->getMemberExportDirectory() . '/' . $a_rel_name);
70  return false;
71  }
72 
73  return true;
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 127 of file class.ilFSStorageGroup.php.

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

128  {
129  return $this->deleteFile($this->getMemberExportDirectory() . '/' . $a_export_name);
130  }
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 52 of file class.ilFSStorageGroup.php.

References ilFileSystemStorage\getAbsolutePath().

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

53  {
54  return $this->getAbsolutePath() . '/' . self::MEMBER_EXPORT_DIR;
55  }
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 111 of file class.ilFSStorageGroup.php.

References getMemberExportDirectory().

112  {
113  $file_name = $this->getMemberExportDirectory() . '/' . $a_name;
114 
115  if (@file_exists($file_name)) {
116  return file_get_contents($file_name);
117  }
118  }
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 $files, ilFileSystemStorage\getContainerId(), and getMemberExportDirectory().

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

◆ getPathPostfix()

ilFSStorageGroup::getPathPostfix ( )
protected

Implementation of abstract method.

protected

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

143  {
144  return 'grp';
145  }

◆ getPathPrefix()

ilFSStorageGroup::getPathPrefix ( )
protected

Implementation of abstract method.

protected

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

154  {
155  return 'ilGroup';
156  }

◆ initMemberExportDirectory()

ilFSStorageGroup::initMemberExportDirectory ( )

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

public

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

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

Referenced by addMemberExportFile().

42  {
44  }
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: