32 require_once(
"./Services/FileSystem/classes/class.ilFileData.php");
54 define(
'COURSE_PATH',
'course');
55 parent::__construct();
56 $this->course_path = parent::getPath().
"/".COURSE_PATH;
57 $this->course_id = $a_course_id;
70 if(@file_exists($this->course_path.
'/'.$a_rel_name.
'.zip'))
72 return $this->course_path.
'/'.$a_rel_name.
'.zip';
74 if(@file_exists($this->course_path.
'/'.$a_rel_name.
'.pdf'))
76 return $this->course_path.
'/'.$a_rel_name.
'.pdf';
90 $dp = opendir($this->course_path);
92 while(
$file = readdir($dp))
99 if(preg_match(
"/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/",
$file,$matches)
and $matches[3] == $this->course_id)
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->course_path.
'/'.
$file);
108 $files[$timest] = $file_info;
117 $file_name = $this->course_path.
'/'.$a_name;
118 if(@file_exists($file_name))
126 $file_name = $this->course_path.
'/'.$a_name;
127 if(@file_exists($file_name))
129 return file_get_contents($file_name);
136 $this->
deleteZipFile($this->course_path.
'/'.$a_rel_name.
'.zip');
139 $this->
deletePdf($this->course_path.
'/'.$a_rel_name.
'.pdf');
145 if(@file_exists($a_abs_name))
147 @unlink($a_abs_name);
155 if(file_exists($a_abs_name))
165 if(@file_exists($a_abs_name))
167 @unlink($a_abs_name);
176 if(@file_exists($a_from))
202 if(!$fp = @fopen($this->
getCoursePath().
'/'.$a_rel_name,
'w+'))
204 die(
"Cannot open file: ".$this->
getCoursePath().
'/'.$a_rel_name);
206 @fwrite($fp,$a_data);
251 $this->
getCoursePath().
'/import/crs_'.$this->course_id.
'/'.$a_name);
252 $this->import_file_info = pathinfo($this->
getCoursePath().
'/import/crs_'.$this->course_id.
'/'.$a_name);
263 if(!is_dir($this->
getCoursePath().
'/import/crs_'.$this->course_id).
'/'.
264 basename($this->import_file_info[
'basename'],
'.zip'))
268 if(!file_exists($this->
getCoursePath().
'/import/crs_'.$this->course_id
269 .
'/'.basename($this->import_file_info[
'basename'],
'.zip')
270 .
'/'.basename($this->import_file_info[
'basename'],
'.zip').
'.xml'))
278 return $this->
getCoursePath().
'/import/crs_'.$this->course_id
279 .
'/'.basename($this->import_file_info[
'basename'],
'.zip')
280 .
'/'.basename($this->import_file_info[
'basename'],
'.zip').
'.xml';
293 if(!@file_exists(CLIENT_WEB_DIR.
'/courses'))
313 $this->
ilias->raiseError(
"Course import path is not readable/writable by webserver",$this->
ilias->error_obj->FATAL);
325 if(is_writable($this->course_path) && is_readable($this->course_path))
331 $this->
ilias->raiseError(
"Course directory is not readable/writable by webserver",$this->
ilias->error_obj->FATAL);
342 if(is_writable($this->
getPath()))
345 $this->course_path = $this->
getPath().
'/'.COURSE_PATH;
getOnlineLink($a_rel_name)
getMemberExportFiles()
Get all member export files.
This class handles all operations of archive files for the course object.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
getArchiveFile($a_rel_name)
createOnlineVersion($a_rel_name)
createImportFile($a_tmp_name, $a_name)
zipFile($a_rel_name, $a_zip_name)
getMemberExportFile($a_name)
This class handles all operations on files in directory /ilias_data/.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
__construct($a_course_id)
Constructor call base constructors checks if directory is writable and sets the optional obj_id...
redirection script todo: (a better solution should control the processing via a xml file) ...
static zip($a_dir, $a_file, $compress_content=false)
zips given directory/file into given zip.file
Create styles array
The data for the language used.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
__initDirectory()
init directory overwritten method public
deleteZipFile($a_abs_name)
writeToFile($a_data, $a_rel_name)
__checkReadWrite()
check if directory is writable overwritten method from base class private
deleteMemberExportFile($a_name)
getCoursePath()
get exercise path public
deleteArchive($a_rel_name)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
deleteDirectory($a_abs_name)
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
addDirectory($a_rel_name)