ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

@access public

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

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

References $log, and ilFileSystemStorage\STORAGE_DATA.

◆ __construct() [2/2]

ilFSStorageCourse::__construct (   $a_container_id = 0)

Constructor.

@access public

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

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

References $log, and ilFileSystemStorage\STORAGE_DATA.

Member Function Documentation

◆ _clone()

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

Clone course data directory.

@access public

Parameters
stringobj_id source
stringobj_id target

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

65 {
66 $source = new ilFSStorageCourse($a_source_id);
67 $target = new ilFSStorageCourse($a_target_id);
68
69 $target->create();
70 ilFileSystemStorage::_copyDirectory($source->getAbsolutePath(), $target->getAbsolutePath());
71
72 // Delete member export files
73 $target->deleteDirectory($target->getMemberExportDirectory());
74
75 unset($source);
76 unset($target);
77 return true;
78 }
$source
Definition: linkback.php:22
static _copyDirectory($a_source, $a_target)
Copy directory and all contents.

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

+ Here is the call graph for this function:

◆ addArchiveSubDirectory() [1/2]

ilFSStorageCourse::addArchiveSubDirectory (   $a_name)

Add subdirectory for archives.

@access public

Parameters
stringarchive subdirectory name

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

233 {
234 ilUtil::makeDirParents($this->getArchiveDirectory() . '/' . $a_name);
235 }
getArchiveDirectory()
Get archive directory.
static makeDirParents($a_dir)
Create a new directory and all parent directories.

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

+ Here is the call graph for this function:

◆ addArchiveSubDirectory() [2/2]

ilFSStorageCourse::addArchiveSubDirectory (   $a_name)

Add subdirectory for archives.

@access public

Parameters
stringarchive subdirectory name

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

204 {
205 ilUtil::makeDirParents($this->getArchiveDirectory() . '/' . $a_name);
206 }

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

+ Here is the call graph for this function:

◆ addMemberExportFile() [1/2]

ilFSStorageCourse::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

@access public

Parameters
stringdata
stringfilename

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

135 {
137 if (!$this->writeToFile($a_data, $this->getMemberExportDirectory() . '/' . $a_rel_name)) {
138 $this->log->write('Cannot write to file: ' . $this->getMemberExportDirectory() . '/' . $a_rel_name);
139 return false;
140 }
141
142 return true;
143 }
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.

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

+ Here is the call graph for this function:

◆ addMemberExportFile() [2/2]

ilFSStorageCourse::addMemberExportFile (   $a_data,
  $a_rel_name 
)

Add new export file.

@access public

Parameters
stringdata
stringfilename

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

110 {
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 }

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

+ Here is the call graph for this function:

◆ createArchiveOnlineVersion() [1/2]

ilFSStorageCourse::createArchiveOnlineVersion (   $a_rel_name)

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

284 {
285 ilUtil::makeDirParents(CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
286 ilUtil::rCopy($this->getArchiveDirectory() . '/' . $a_rel_name, CLIENT_WEB_DIR . '/courses/' . $a_rel_name);
287
288 return true;
289 }
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.

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

+ Here is the call graph for this function:

◆ createArchiveOnlineVersion() [2/2]

ilFSStorageCourse::createArchiveOnlineVersion (   $a_rel_name)

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

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 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

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

+ Here is the call graph for this function:

◆ deleteArchive() [1/2]

ilFSStorageCourse::deleteArchive (   $a_rel_name)

Delete one archive.

@access public

Parameters

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

278 {
279 $this->deleteFile($this->getArchiveDirectory() . '/' . $a_rel_name . '.zip');
280 $this->deleteDirectory($this->getArchiveDirectory() . '/' . $a_rel_name);
281 }
deleteFile($a_abs_name)
Delete file.
deleteDirectory($a_abs_name)
Delete directory.

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

+ Here is the call graph for this function:

◆ deleteArchive() [2/2]

ilFSStorageCourse::deleteArchive (   $a_rel_name)

Delete one archive.

@access public

Parameters

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

247 {
248 $this->deleteFile($this->getArchiveDirectory() . '/' . $a_rel_name . '.zip');
249 $this->deleteDirectory($this->getArchiveDirectory() . '/' . $a_rel_name);
250 }

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

+ Here is the call graph for this function:

◆ deleteMemberExportFile() [1/2]

ilFSStorageCourse::deleteMemberExportFile (   $a_export_name)

Delete Member Export File.

@access public

Parameters

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

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

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

+ Here is the call graph for this function:

◆ deleteMemberExportFile() [2/2]

ilFSStorageCourse::deleteMemberExportFile (   $a_export_name)

Delete Member Export File.

@access public

Parameters

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

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

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

+ Here is the call graph for this function:

◆ getArchiveDirectory() [1/2]

ilFSStorageCourse::getArchiveDirectory ( )

Get archive directory.

@access public

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

221 {
222 return $this->getAbsolutePath() . '/' . self::ARCHIVE_DIR;
223 }
getAbsolutePath()
Get absolute path of storage directory.

References ARCHIVE_DIR, and ilFileSystemStorage\getAbsolutePath().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getArchiveDirectory() [2/2]

ilFSStorageCourse::getArchiveDirectory ( )

Get archive directory.

@access public

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

192 {
193 return $this->getAbsolutePath() . '/' . self::ARCHIVE_DIR;
194 }

References ARCHIVE_DIR, and ilFileSystemStorage\getAbsolutePath().

+ Here is the call graph for this function:

◆ getInfoDirectory() [1/2]

ilFSStorageCourse::getInfoDirectory ( )

Get course info directory.

@access public

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

99 {
100 return $this->getAbsolutePath() . '/' . self::INFO_DIR;
101 }

References ilFileSystemStorage\getAbsolutePath(), and INFO_DIR.

Referenced by initInfoDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoDirectory() [2/2]

ilFSStorageCourse::getInfoDirectory ( )

Get course info directory.

@access public

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

74 {
75 return $this->getAbsolutePath() . '/' . self::INFO_DIR;
76 }

References ilFileSystemStorage\getAbsolutePath(), and INFO_DIR.

+ Here is the call graph for this function:

◆ getMemberExportDirectory() [1/2]

ilFSStorageCourse::getMemberExportDirectory ( )

Get path of export directory.

@access public

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

122 {
123 return $this->getAbsolutePath() . '/' . self::MEMBER_EXPORT_DIR;
124 }

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:

◆ getMemberExportDirectory() [2/2]

ilFSStorageCourse::getMemberExportDirectory ( )

Get path of export directory.

@access public

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

97 {
98 return $this->getAbsolutePath() . '/' . self::MEMBER_EXPORT_DIR;
99 }

References ilFileSystemStorage\getAbsolutePath(), and MEMBER_EXPORT_DIR.

+ Here is the call graph for this function:

◆ getMemberExportFile() [1/2]

ilFSStorageCourse::getMemberExportFile (   $a_name)

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

181 {
182 $file_name = $this->getMemberExportDirectory() . '/' . $a_name;
183
184 if (@file_exists($file_name)) {
185 return file_get_contents($file_name);
186 }
187 }

References getMemberExportDirectory().

+ Here is the call graph for this function:

◆ getMemberExportFile() [2/2]

ilFSStorageCourse::getMemberExportFile (   $a_name)

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

152 {
153 $file_name = $this->getMemberExportDirectory() . '/' . $a_name;
154
155 if (@file_exists($file_name)) {
156 return file_get_contents($file_name);
157 }
158 }

References getMemberExportDirectory().

+ Here is the call graph for this function:

◆ getMemberExportFiles() [1/2]

ilFSStorageCourse::getMemberExportFiles ( )

Get all member export files.

@access public

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

152 {
153 if (!@is_dir($this->getMemberExportDirectory())) {
154 return array();
155 }
156
157 $files = array();
158 $dp = @opendir($this->getMemberExportDirectory());
159
160 while ($file = readdir($dp)) {
161 if (is_dir($file)) {
162 continue;
163 }
164
165 if (preg_match("/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/", $file, $matches) and $matches[3] == $this->getContainerId()) {
166 $timest = $matches[1];
167 $file_info['name'] = $matches[0];
168 $file_info['timest'] = $matches[1];
169 $file_info['type'] = $matches[2];
170 $file_info['id'] = $matches[3];
171 $file_info['size'] = filesize($this->getMemberExportDirectory() . '/' . $file);
172
173 $files[$timest] = $file_info;
174 }
175 }
176 closedir($dp);
177 return $files ? $files : array();
178 }
$files
Definition: add-vimline.php:18
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

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

+ Here is the call graph for this function:

◆ getMemberExportFiles() [2/2]

ilFSStorageCourse::getMemberExportFiles ( )

Get all member export files.

@access public

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

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 }

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

+ Here is the call graph for this function:

◆ getOnlineLink() [1/2]

ilFSStorageCourse::getOnlineLink (   $a_rel_name)

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

292 {
293 return ilUtil::getWebspaceDir('filesystem') . '/courses/' . $a_rel_name . '/index.html';
294 }
static getWebspaceDir($mode="filesystem")
get webspace directory

References ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ getOnlineLink() [2/2]

ilFSStorageCourse::getOnlineLink (   $a_rel_name)

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

261 {
262 return ilUtil::getWebspaceDir('filesystem') . '/courses/' . $a_rel_name . '/index.html';
263 }

References ilUtil\getWebspaceDir().

+ Here is the call graph for this function:

◆ getPathPostfix() [1/2]

ilFSStorageCourse::getPathPostfix ( )
protected

Implementation of abstract method.

@access protected

Reimplemented from ilFileSystemStorage.

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

304 {
305 return 'crs';
306 }

◆ getPathPostfix() [2/2]

ilFSStorageCourse::getPathPostfix ( )
protected

Implementation of abstract method.

@access protected

Reimplemented from ilFileSystemStorage.

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

273 {
274 return 'course';
275 }

◆ getPathPrefix() [1/2]

ilFSStorageCourse::getPathPrefix ( )
protected

Implementation of abstract method.

@access protected

Reimplemented from ilFileSystemStorage.

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

315 {
316 return 'ilCourse';
317 }

◆ getPathPrefix() [2/2]

ilFSStorageCourse::getPathPrefix ( )
protected

Implementation of abstract method.

@access protected

Reimplemented from ilFileSystemStorage.

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

284 {
285 return 'ilCourses';
286 }

◆ initArchiveDirectory() [1/2]

ilFSStorageCourse::initArchiveDirectory ( )

init Archive Directory

@access public

Parameters

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

210 {
212 }

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

+ Here is the call graph for this function:

◆ initArchiveDirectory() [2/2]

ilFSStorageCourse::initArchiveDirectory ( )

init Archive Directory

@access public

Parameters

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

181 {
183 }

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

+ Here is the call graph for this function:

◆ initInfoDirectory() [1/2]

ilFSStorageCourse::initInfoDirectory ( )

init info directory

@access public

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

88 {
90 }
getInfoDirectory()
Get course info directory.

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

+ Here is the call graph for this function:

◆ initInfoDirectory() [2/2]

ilFSStorageCourse::initInfoDirectory ( )

init info directory

@access public

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

63 {
65 }

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

+ Here is the call graph for this function:

◆ initMemberExportDirectory() [1/2]

ilFSStorageCourse::initMemberExportDirectory ( )

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

@access public

Definition at line 110 of file class.ilFSStorageCourse.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:

◆ initMemberExportDirectory() [2/2]

ilFSStorageCourse::initMemberExportDirectory ( )

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

@access public

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

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

+ Here is the call graph for this function:

◆ writeArchiveFile() [1/2]

ilFSStorageCourse::writeArchiveFile (   $a_data,
  $a_rel_name 
)

Write archive string to file.

@access public

Parameters
stringrelative filename

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

245 {
246 if (!$this->writeToFile($a_data, $this->getArchiveDirectory() . '/' . $a_rel_name)) {
247 $this->log->write('Cannot write to file: ' . $this->getArchiveDirectory() . '/' . $a_rel_name);
248 return false;
249 }
250 return true;
251 }

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

+ Here is the call graph for this function:

◆ writeArchiveFile() [2/2]

ilFSStorageCourse::writeArchiveFile (   $a_data,
  $a_rel_name 
)

Write archive string to file.

@access public

Parameters
stringrelative filename

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

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 }

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

+ Here is the call graph for this function:

◆ zipArchive() [1/2]

ilFSStorageCourse::zipArchive (   $a_rel_name,
  $a_zip_name 
)

Zip archive directory.

@access public

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

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

263 {
264 if (ilUtil::zip($this->getArchiveDirectory() . '/' . $a_rel_name, $this->getArchiveDirectory() . '/' . $a_zip_name)) {
265 return filesize($this->getArchiveDirectory() . '/' . $a_zip_name);
266 }
267 return 0;
268 }
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file

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

+ Here is the call graph for this function:

◆ zipArchive() [2/2]

ilFSStorageCourse::zipArchive (   $a_rel_name,
  $a_zip_name 
)

Zip archive directory.

@access 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.

234 {
235 ilUtil::zip($this->getArchiveDirectory() . '/' . $a_rel_name, $this->getArchiveDirectory() . '/' . $a_zip_name);
236 return filesize($this->getArchiveDirectory() . '/' . $a_zip_name);
237 }

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

+ 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.

Referenced by getArchiveDirectory().

◆ INFO_DIR

const ilFSStorageCourse::INFO_DIR = 'info'

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

Referenced by getInfoDirectory().

◆ MEMBER_EXPORT_DIR

const ilFSStorageCourse::MEMBER_EXPORT_DIR = 'memberExport'

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

Referenced by getMemberExportDirectory().


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