ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilFSStorageCourse Class Reference
+ Inheritance diagram for ilFSStorageCourse:
+ Collaboration diagram for ilFSStorageCourse:

Public Member Functions

 __construct ($a_container_id=0)
 Constructor. More...
 
 initInfoDirectory ()
 init info directory More...
 
 getInfoDirectory ()
 Get course info directory. 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...
 
 initArchiveDirectory ()
 init Archive Directory More...
 
 getArchiveDirectory ()
 Get archive directory. More...
 
 addArchiveSubDirectory ($a_name)
 Add subdirectory for archives. More...
 
 writeArchiveFile ($a_data, $a_rel_name)
 Write archive string to file. More...
 
 zipArchive ($a_rel_name, $a_zip_name)
 Zip archive directory. More...
 
 deleteArchive ($a_rel_name)
 Delete one archive. More...
 
 createArchiveOnlineVersion ($a_rel_name)
 
 getOnlineLink ($a_rel_name)
 
 __construct ($a_container_id=0)
 Constructor. More...
 
 initInfoDirectory ()
 init info directory More...
 
 getInfoDirectory ()
 Get course info directory. 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...
 
 initArchiveDirectory ()
 init Archive Directory More...
 
 getArchiveDirectory ()
 Get archive directory. More...
 
 addArchiveSubDirectory ($a_name)
 Add subdirectory for archives. More...
 
 writeArchiveFile ($a_data, $a_rel_name)
 Write archive string to file. More...
 
 zipArchive ($a_rel_name, $a_zip_name)
 Zip archive directory. More...
 
 deleteArchive ($a_rel_name)
 Delete one archive. More...
 
 createArchiveOnlineVersion ($a_rel_name)
 
 getOnlineLink ($a_rel_name)
 
- 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)
 

Static Public Member Functions

static _clone ($a_source_id, $a_target_id)
 Clone course data directory. More...
 
- 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...
 

Data Fields

const MEMBER_EXPORT_DIR = 'memberExport'
 
const INFO_DIR = 'info'
 
const ARCHIVE_DIR = 'archives'
 
- 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...
 
 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

- 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 34 of file class.ilFSStorageCourse.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

ilFSStorageCourse::__construct (   $a_container_id = 0)

Constructor.

public

Definition at line 47 of file class.ilFSStorageCourse.php.

References $DIC, $log, and ilFileSystemStorage\STORAGE_DATA.

48  {
49  global $DIC;
50 
51  $log = $DIC['log'];
52 
53  $this->log = $log;
54  parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $a_container_id);
55  }
global $DIC
Definition: saml.php:7

◆ __construct() [2/2]

ilFSStorageCourse::__construct (   $a_container_id = 0)

Constructor.

public

Definition at line 47 of file class.ilFSStorageCourse.php.

References $log, and ilFileSystemStorage\STORAGE_DATA.

48  {
49  global $log;
50 
51  $this->log = $log;
52  parent::__construct(ilFileSystemStorage::STORAGE_DATA, true, $a_container_id);
53  }

Member Function Documentation

◆ _clone()

static ilFSStorageCourse::_clone (   $a_source_id,
  $a_target_id 
)
static

Clone course data directory.

public

Parameters
stringobj_id source
stringobj_id target

Definition at line 66 of file class.ilFSStorageCourse.php.

References $source, $target, and ilFileSystemStorage\_copyDirectory().

67  {
68  $source = new ilFSStorageCourse($a_source_id);
69  $target = new ilFSStorageCourse($a_target_id);
70 
71  $target->create();
72  ilFileSystemStorage::_copyDirectory($source->getAbsolutePath(), $target->getAbsolutePath());
73 
74  // Delete member export files
75  $target->deleteDirectory($target->getMemberExportDirectory());
76 
77  unset($source);
78  unset($target);
79  return true;
80  }
static _copyDirectory($a_source, $a_target)
Copy directory and all contents.
$source
Definition: linkback.php:22
$target
Definition: test.php:19
+ Here is the call graph for this function:

◆ addArchiveSubDirectory() [1/2]

ilFSStorageCourse::addArchiveSubDirectory (   $a_name)

Add subdirectory for archives.

public

Parameters
stringarchive subdirectory name

Definition at line 203 of file class.ilFSStorageCourse.php.

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

204  {
205  ilUtil::makeDirParents($this->getArchiveDirectory() . '/' . $a_name);
206  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getArchiveDirectory()
Get archive directory.
+ Here is the call graph for this function:

◆ addArchiveSubDirectory() [2/2]

ilFSStorageCourse::addArchiveSubDirectory (   $a_name)

Add subdirectory for archives.

public

Parameters
stringarchive subdirectory name

Definition at line 234 of file class.ilFSStorageCourse.php.

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

235  {
236  ilUtil::makeDirParents($this->getArchiveDirectory() . '/' . $a_name);
237  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getArchiveDirectory()
Get archive directory.
+ Here is the call graph for this function:

◆ addMemberExportFile() [1/2]

ilFSStorageCourse::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

public

Parameters
stringdata
stringfilename

Definition at line 109 of file class.ilFSStorageCourse.php.

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

110  {
111  $this->initMemberExportDirectory();
112  if (!$this->writeToFile($a_data, $this->getMemberExportDirectory() . '/' . $a_rel_name)) {
113  $this->log->write('Cannot write to file: ' . $this->getMemberExportDirectory() . '/' . $a_rel_name);
114  return false;
115  }
116 
117  return true;
118  }
initMemberExportDirectory()
Init export directory and create it if it does not exist.
getMemberExportDirectory()
Get path of export directory.
writeToFile($a_data, $a_absolute_path)
Write data to file.
+ Here is the call graph for this function:

◆ addMemberExportFile() [2/2]

ilFSStorageCourse::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

public

Parameters
stringdata
stringfilename

Definition at line 136 of file class.ilFSStorageCourse.php.

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

137  {
138  $this->initMemberExportDirectory();
139  if (!$this->writeToFile($a_data, $this->getMemberExportDirectory() . '/' . $a_rel_name)) {
140  $this->log->write('Cannot write to file: ' . $this->getMemberExportDirectory() . '/' . $a_rel_name);
141  return false;
142  }
143 
144  return true;
145  }
initMemberExportDirectory()
Init export directory and create it if it does not exist.
getMemberExportDirectory()
Get path of export directory.
writeToFile($a_data, $a_absolute_path)
Write data to file.
+ Here is the call graph for this function:

◆ createArchiveOnlineVersion() [1/2]

ilFSStorageCourse::createArchiveOnlineVersion (   $a_rel_name)

Definition at line 252 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), ilUtil\makeDir(), and ilUtil\rCopy().

253  {
254  ilUtil::makeDir(CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
255  ilUtil::rCopy($this->getArchiveDirectory() . '/' . $a_rel_name, CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
256 
257  return true;
258  }
getArchiveDirectory()
Get archive directory.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:

◆ createArchiveOnlineVersion() [2/2]

ilFSStorageCourse::createArchiveOnlineVersion (   $a_rel_name)

Definition at line 285 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), ilUtil\makeDirParents(), and ilUtil\rCopy().

286  {
287  ilUtil::makeDirParents(CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
288  ilUtil::rCopy($this->getArchiveDirectory() . '/' . $a_rel_name, CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
289 
290  return true;
291  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getArchiveDirectory()
Get archive directory.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
+ Here is the call graph for this function:

◆ deleteArchive() [1/2]

ilFSStorageCourse::deleteArchive (   $a_rel_name)

Delete one archive.

public

Parameters

Definition at line 246 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\deleteDirectory(), ilFileSystemStorage\deleteFile(), and getArchiveDirectory().

247  {
248  $this->deleteFile($this->getArchiveDirectory() . '/' . $a_rel_name . '.zip');
249  $this->deleteDirectory($this->getArchiveDirectory() . '/' . $a_rel_name);
250  }
getArchiveDirectory()
Get archive directory.
deleteDirectory($a_abs_name)
Delete directory.
deleteFile($a_abs_name)
Delete file.
+ Here is the call graph for this function:

◆ deleteArchive() [2/2]

ilFSStorageCourse::deleteArchive (   $a_rel_name)

Delete one archive.

public

Parameters

Definition at line 279 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\deleteDirectory(), ilFileSystemStorage\deleteFile(), and getArchiveDirectory().

280  {
281  $this->deleteFile($this->getArchiveDirectory() . '/' . $a_rel_name . '.zip');
282  $this->deleteDirectory($this->getArchiveDirectory() . '/' . $a_rel_name);
283  }
getArchiveDirectory()
Get archive directory.
deleteDirectory($a_abs_name)
Delete directory.
deleteFile($a_abs_name)
Delete file.
+ Here is the call graph for this function:

◆ deleteMemberExportFile() [1/2]

ilFSStorageCourse::deleteMemberExportFile (   $a_export_name)

Delete Member Export File.

public

Parameters

Definition at line 167 of file class.ilFSStorageCourse.php.

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

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

◆ deleteMemberExportFile() [2/2]

ilFSStorageCourse::deleteMemberExportFile (   $a_export_name)

Delete Member Export File.

public

Parameters

Definition at line 198 of file class.ilFSStorageCourse.php.

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

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

◆ getArchiveDirectory() [1/2]

ilFSStorageCourse::getArchiveDirectory ( )

Get archive directory.

public

Definition at line 191 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

192  {
193  return $this->getAbsolutePath() . '/' . self::ARCHIVE_DIR;
194  }
getAbsolutePath()
Get absolute path of storage directory.
+ Here is the call graph for this function:

◆ getArchiveDirectory() [2/2]

ilFSStorageCourse::getArchiveDirectory ( )

Get archive directory.

public

Definition at line 222 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

Referenced by addArchiveSubDirectory(), createArchiveOnlineVersion(), deleteArchive(), initArchiveDirectory(), writeArchiveFile(), and zipArchive().

223  {
224  return $this->getAbsolutePath() . '/' . self::ARCHIVE_DIR;
225  }
getAbsolutePath()
Get absolute path of storage directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoDirectory() [1/2]

ilFSStorageCourse::getInfoDirectory ( )

Get course info directory.

public

Definition at line 73 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

74  {
75  return $this->getAbsolutePath() . '/' . self::INFO_DIR;
76  }
getAbsolutePath()
Get absolute path of storage directory.
+ Here is the call graph for this function:

◆ getInfoDirectory() [2/2]

ilFSStorageCourse::getInfoDirectory ( )

Get course info directory.

public

Definition at line 100 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

Referenced by initInfoDirectory().

101  {
102  return $this->getAbsolutePath() . '/' . self::INFO_DIR;
103  }
getAbsolutePath()
Get absolute path of storage directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberExportDirectory() [1/2]

ilFSStorageCourse::getMemberExportDirectory ( )

Get path of export directory.

public

Definition at line 96 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

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

◆ getMemberExportDirectory() [2/2]

ilFSStorageCourse::getMemberExportDirectory ( )

Get path of export directory.

public

Definition at line 123 of file class.ilFSStorageCourse.php.

References ilFileSystemStorage\getAbsolutePath().

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

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

◆ getMemberExportFile() [1/2]

ilFSStorageCourse::getMemberExportFile (   $a_name)

Definition at line 151 of file class.ilFSStorageCourse.php.

References getMemberExportDirectory().

152  {
153  $file_name = $this->getMemberExportDirectory() . '/' . $a_name;
154 
155  if (@file_exists($file_name)) {
156  return file_get_contents($file_name);
157  }
158  }
getMemberExportDirectory()
Get path of export directory.
+ Here is the call graph for this function:

◆ getMemberExportFile() [2/2]

ilFSStorageCourse::getMemberExportFile (   $a_name)

Definition at line 182 of file class.ilFSStorageCourse.php.

References getMemberExportDirectory().

183  {
184  $file_name = $this->getMemberExportDirectory() . '/' . $a_name;
185 
186  if (@file_exists($file_name)) {
187  return file_get_contents($file_name);
188  }
189  }
getMemberExportDirectory()
Get path of export directory.
+ Here is the call graph for this function:

◆ getMemberExportFiles() [1/2]

ilFSStorageCourse::getMemberExportFiles ( )

Get all member export files.

public

Definition at line 126 of file class.ilFSStorageCourse.php.

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

127  {
128  $files = array();
129  $dp = opendir($this->getMemberExportDirectory());
130 
131  while ($file = readdir($dp)) {
132  if (is_dir($file)) {
133  continue;
134  }
135 
136  if (preg_match("/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/", $file, $matches) and $matches[3] == $this->getContainerId()) {
137  $timest = $matches[1];
138  $file_info['name'] = $matches[0];
139  $file_info['timest'] = $matches[1];
140  $file_info['type'] = $matches[2];
141  $file_info['id'] = $matches[3];
142  $file_info['size'] = filesize($this->getMemberExportDirectory() . '/' . $file);
143 
144  $files[$timest] = $file_info;
145  }
146  }
147  closedir($dp);
148  return $files ? $files : array();
149  }
getMemberExportDirectory()
Get path of export directory.
$files
Definition: metarefresh.php:49
+ Here is the call graph for this function:

◆ getMemberExportFiles() [2/2]

ilFSStorageCourse::getMemberExportFiles ( )

Get all member export files.

public

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

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

154  {
155  if (!@is_dir($this->getMemberExportDirectory())) {
156  return array();
157  }
158 
159  $files = array();
160  $dp = @opendir($this->getMemberExportDirectory());
161 
162  while ($file = readdir($dp)) {
163  if (is_dir($file)) {
164  continue;
165  }
166 
167  if (preg_match("/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/", $file, $matches) and $matches[3] == $this->getContainerId()) {
168  $timest = $matches[1];
169  $file_info['name'] = $matches[0];
170  $file_info['timest'] = $matches[1];
171  $file_info['type'] = $matches[2];
172  $file_info['id'] = $matches[3];
173  $file_info['size'] = filesize($this->getMemberExportDirectory() . '/' . $file);
174 
175  $files[$timest] = $file_info;
176  }
177  }
178  closedir($dp);
179  return $files ? $files : array();
180  }
getMemberExportDirectory()
Get path of export directory.
$files
Definition: metarefresh.php:49
+ Here is the call graph for this function:

◆ getOnlineLink() [1/2]

ilFSStorageCourse::getOnlineLink (   $a_rel_name)

Definition at line 260 of file class.ilFSStorageCourse.php.

References ilUtil\getWebspaceDir().

261  {
262  return ilUtil::getWebspaceDir('filesystem') . '/courses/' . $a_rel_name . '/index.html';
263  }
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ getOnlineLink() [2/2]

ilFSStorageCourse::getOnlineLink (   $a_rel_name)

Definition at line 293 of file class.ilFSStorageCourse.php.

References ilUtil\getWebspaceDir().

294  {
295  return ilUtil::getWebspaceDir('filesystem') . '/courses/' . $a_rel_name . '/index.html';
296  }
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ getPathPostfix() [1/2]

ilFSStorageCourse::getPathPostfix ( )
protected

Implementation of abstract method.

protected

Definition at line 272 of file class.ilFSStorageCourse.php.

273  {
274  return 'course';
275  }

◆ getPathPostfix() [2/2]

ilFSStorageCourse::getPathPostfix ( )
protected

Implementation of abstract method.

protected

Definition at line 305 of file class.ilFSStorageCourse.php.

306  {
307  return 'crs';
308  }

◆ getPathPrefix() [1/2]

ilFSStorageCourse::getPathPrefix ( )
protected

Implementation of abstract method.

protected

Definition at line 283 of file class.ilFSStorageCourse.php.

284  {
285  return 'ilCourses';
286  }

◆ getPathPrefix() [2/2]

ilFSStorageCourse::getPathPrefix ( )
protected

Implementation of abstract method.

protected

Definition at line 316 of file class.ilFSStorageCourse.php.

317  {
318  return 'ilCourse';
319  }

◆ initArchiveDirectory() [1/2]

ilFSStorageCourse::initArchiveDirectory ( )

init Archive Directory

public

Parameters

Definition at line 180 of file class.ilFSStorageCourse.php.

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

181  {
183  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getArchiveDirectory()
Get archive directory.
+ Here is the call graph for this function:

◆ initArchiveDirectory() [2/2]

ilFSStorageCourse::initArchiveDirectory ( )

init Archive Directory

public

Parameters

Definition at line 211 of file class.ilFSStorageCourse.php.

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

212  {
214  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getArchiveDirectory()
Get archive directory.
+ Here is the call graph for this function:

◆ initInfoDirectory() [1/2]

ilFSStorageCourse::initInfoDirectory ( )

init info directory

public

Definition at line 62 of file class.ilFSStorageCourse.php.

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

63  {
65  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getInfoDirectory()
Get course info directory.
+ Here is the call graph for this function:

◆ initInfoDirectory() [2/2]

ilFSStorageCourse::initInfoDirectory ( )

init info directory

public

Definition at line 89 of file class.ilFSStorageCourse.php.

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

90  {
92  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getInfoDirectory()
Get course info directory.
+ Here is the call graph for this function:

◆ initMemberExportDirectory() [1/2]

ilFSStorageCourse::initMemberExportDirectory ( )

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

public

Definition at line 85 of file class.ilFSStorageCourse.php.

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

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

◆ initMemberExportDirectory() [2/2]

ilFSStorageCourse::initMemberExportDirectory ( )

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

public

Definition at line 112 of file class.ilFSStorageCourse.php.

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

Referenced by addMemberExportFile().

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

◆ writeArchiveFile() [1/2]

ilFSStorageCourse::writeArchiveFile (   $a_data,
  $a_rel_name 
)

Write archive string to file.

public

Parameters
stringrelative filename

Definition at line 215 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), and ilFileSystemStorage\writeToFile().

216  {
217  if (!$this->writeToFile($a_data, $this->getArchiveDirectory() . '/' . $a_rel_name)) {
218  $this->log->write('Cannot write to file: ' . $this->getArchiveDirectory() . '/' . $a_rel_name);
219  return false;
220  }
221  return true;
222  }
getArchiveDirectory()
Get archive directory.
writeToFile($a_data, $a_absolute_path)
Write data to file.
+ Here is the call graph for this function:

◆ writeArchiveFile() [2/2]

ilFSStorageCourse::writeArchiveFile (   $a_data,
  $a_rel_name 
)

Write archive string to file.

public

Parameters
stringrelative filename

Definition at line 246 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), and ilFileSystemStorage\writeToFile().

247  {
248  if (!$this->writeToFile($a_data, $this->getArchiveDirectory() . '/' . $a_rel_name)) {
249  $this->log->write('Cannot write to file: ' . $this->getArchiveDirectory() . '/' . $a_rel_name);
250  return false;
251  }
252  return true;
253  }
getArchiveDirectory()
Get archive directory.
writeToFile($a_data, $a_absolute_path)
Write data to file.
+ Here is the call graph for this function:

◆ zipArchive() [1/2]

ilFSStorageCourse::zipArchive (   $a_rel_name,
  $a_zip_name 
)

Zip archive directory.

public

Parameters
stringrelative name of directory to zip
stringzip archive name
Returns
int filesize of zip archive

Definition at line 233 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), and ilUtil\zip().

234  {
235  ilUtil::zip($this->getArchiveDirectory() . '/' . $a_rel_name, $this->getArchiveDirectory() . '/' . $a_zip_name);
236  return filesize($this->getArchiveDirectory() . '/' . $a_zip_name);
237  }
getArchiveDirectory()
Get archive directory.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
+ Here is the call graph for this function:

◆ zipArchive() [2/2]

ilFSStorageCourse::zipArchive (   $a_rel_name,
  $a_zip_name 
)

Zip archive directory.

public

Parameters
stringrelative name of directory to zip
stringzip archive name
Returns
int filesize of zip archive

Definition at line 264 of file class.ilFSStorageCourse.php.

References getArchiveDirectory(), and ilUtil\zip().

265  {
266  if (ilUtil::zip($this->getArchiveDirectory() . '/' . $a_rel_name, $this->getArchiveDirectory() . '/' . $a_zip_name)) {
267  return filesize($this->getArchiveDirectory() . '/' . $a_zip_name);
268  }
269  return 0;
270  }
getArchiveDirectory()
Get archive directory.
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
+ Here is the call graph for this function:

Field Documentation

◆ $log

ilFSStorageCourse::$log
private

Definition at line 40 of file class.ilFSStorageCourse.php.

Referenced by __construct().

◆ ARCHIVE_DIR

const ilFSStorageCourse::ARCHIVE_DIR = 'archives'

Definition at line 38 of file class.ilFSStorageCourse.php.

◆ INFO_DIR

const ilFSStorageCourse::INFO_DIR = 'info'

Definition at line 37 of file class.ilFSStorageCourse.php.

◆ MEMBER_EXPORT_DIR

const ilFSStorageCourse::MEMBER_EXPORT_DIR = 'memberExport'

Definition at line 36 of file class.ilFSStorageCourse.php.


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