3 declare(strict_types=0);
    38         $this->error = $DIC[
'ilErr'];
    40         define(
'COURSE_PATH', 
'course');
    43         $this->course_path = parent::getPath() . 
"/" . COURSE_PATH;
    44         $this->course_id = $a_course_id;
    54         if (file_exists($this->course_path . 
'/' . $a_rel_name . 
'.zip')) {
    55             return $this->course_path . 
'/' . $a_rel_name . 
'.zip';
    57         if (file_exists($this->course_path . 
'/' . $a_rel_name . 
'.pdf')) {
    58             return $this->course_path . 
'/' . $a_rel_name . 
'.pdf';
    66         $dp = opendir($this->course_path);
    68         while ($file = readdir($dp)) {
    74                 "/^([0-9]{10})_[a-zA-Z]*_export_([a-z]+)_([0-9]+)\.[a-z]+$/",
    77             ) && $matches[3] == $this->course_id) {
    78                 $timest = $matches[1];
    79                 $file_info[
'name'] = $matches[0];
    80                 $file_info[
'timest'] = $matches[1];
    81                 $file_info[
'type'] = $matches[2];
    82                 $file_info[
'id'] = $matches[3];
    83                 $file_info[
'size'] = filesize($this->course_path . 
'/' . $file);
    85                 $files[$timest] = $file_info;
    94         $file_name = $this->course_path . 
'/' . $a_name;
    95         if (file_exists($file_name)) {
   102         $file_name = $this->course_path . 
'/' . $a_name;
   103         if (file_exists($file_name)) {
   104             return file_get_contents($file_name);
   111         $this->
deleteZipFile($this->course_path . 
'/' . $a_rel_name . 
'.zip');
   114         $this->
deletePdf($this->course_path . 
'/' . $a_rel_name . 
'.pdf');
   119         if (file_exists($a_abs_name)) {
   128         if (file_exists($a_abs_name)) {
   138         if (file_exists($a_abs_name)) {
   146     public function copy(
string $a_from, 
string $a_to): bool
   148         if (file_exists($a_from)) {
   156     public function rCopy(
string $a_from, 
string $a_to): bool
   168     public function writeToFile(
string $a_data, 
string $a_rel_name): bool
   170         if (!$fp = fopen($this->
getCoursePath() . 
'/' . $a_rel_name, 
'w+')) {
   171             die(
"Cannot open file: " . $this->
getCoursePath() . 
'/' . $a_rel_name);
   173         fwrite($fp, $a_data);
   177     public function zipFile(
string $a_rel_name, 
string $a_zip_name): 
int   182         return (
int) filesize($this->
getCoursePath() . 
'/' . $a_zip_name);
   223             $this->error->raiseError(
"Course import path is not readable/writable by webserver", $this->error->FATAL);
   229         if (is_writable($this->course_path) && is_readable($this->course_path)) {
   232             $this->error->raiseError(
"Course directory is not readable/writable by webserver", $this->error->FATAL);
   239         if (is_writable($this->
getPath())) {
   241             $this->course_path = $this->
getPath() . 
'/' . COURSE_PATH;
 static getWebspaceDir(string $mode="filesystem")
get webspace directory 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
createOnlineVersion(string $a_rel_name)
 
getOnlineLink(string $a_rel_name)
 
deletePdf(string $a_abs_name)
 
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir. 
 
getArchiveFile($a_rel_name)
 
deleteArchive(string $a_rel_name)
 
deleteMemberExportFile(string $a_name)
 
deleteDirectory(string $a_abs_name)
 
zipFile(string $a_rel_name, string $a_zip_name)
 
copy(string $a_from, string $a_to)
 
addDirectory(string $a_rel_name)
 
__construct(int $a_course_id)
 
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively 
 
Error Handling & global info handling. 
 
static zip(string $a_dir, string $a_file, bool $compress_content=false)
 
deleteZipFile(string $a_abs_name)
 
writeToFile(string $a_data, string $a_rel_name)
 
getMemberExportFile(string $a_name)
 
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
 
rCopy(string $a_from, string $a_to)