| @@ 4558-4560 (lines=3) @@ | ||
| 4555 | // Simple delete for a file. |
|
| 4556 | if (is_file($dirname) || is_link($dirname)) { |
|
| 4557 | $res = unlink($dirname); |
|
| 4558 | if ($res === false) { |
|
| 4559 | error_log(__FILE__.' line '.__LINE__.': '.((bool)ini_get('track_errors') ? $php_errormsg : 'Error not recorded because track_errors is off in your php.ini'), 0); |
|
| 4560 | } |
|
| 4561 | return $res; |
|
| 4562 | } |
|
| 4563 | ||
| @@ 4595-4597 (lines=3) @@ | ||
| 4592 | ||
| 4593 | if ($delete_only_content_in_folder == false) { |
|
| 4594 | $res = rmdir($dirname); |
|
| 4595 | if ($res === false) { |
|
| 4596 | error_log(__FILE__.' line '.__LINE__.': '.((bool)ini_get('track_errors') ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
| 4597 | } |
|
| 4598 | } |
|
| 4599 | return $res; |
|
| 4600 | } |
|
| @@ 86-89 (lines=4) @@ | ||
| 83 | ||
| 84 | $php_errormsg = ''; |
|
| 85 | $res = @mkdir($backup_dir, $perm_dirs); |
|
| 86 | if ($res === false) { |
|
| 87 | //TODO set and handle an error message telling the user to review the permissions on the archive directory |
|
| 88 | error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini') . ' - This error, occuring because your archive directory will not let this script write data into it, will prevent courses backups to be created', 0); |
|
| 89 | } |
|
| 90 | // Write the course-object to the file |
|
| 91 | $fp = @fopen($course_info_file, 'w'); |
|
| 92 | if ($fp === false) { |
|
| @@ 92-94 (lines=3) @@ | ||
| 89 | } |
|
| 90 | // Write the course-object to the file |
|
| 91 | $fp = @fopen($course_info_file, 'w'); |
|
| 92 | if ($fp === false) { |
|
| 93 | error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
| 94 | } |
|
| 95 | ||
| 96 | $res = @fwrite($fp, base64_encode(serialize($course))); |
|
| 97 | if ($res === false) { |
|
| @@ 97-99 (lines=3) @@ | ||
| 94 | } |
|
| 95 | ||
| 96 | $res = @fwrite($fp, base64_encode(serialize($course))); |
|
| 97 | if ($res === false) { |
|
| 98 | error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
| 99 | } |
|
| 100 | ||
| 101 | $res = @fclose($fp); |
|
| 102 | if ($res === false) { |
|
| @@ 102-104 (lines=3) @@ | ||
| 99 | } |
|
| 100 | ||
| 101 | $res = @fclose($fp); |
|
| 102 | if ($res === false) { |
|
| 103 | error_log(__FILE__ . ' line ' . __LINE__ . ': ' . (ini_get('track_errors') != false ? $php_errormsg : 'error not recorded because track_errors is off in your php.ini'), 0); |
|
| 104 | } |
|
| 105 | ||
| 106 | // Copy all documents to the temp-dir |
|
| 107 | if (isset($course->resources[RESOURCE_DOCUMENT]) && is_array($course->resources[RESOURCE_DOCUMENT])) { |
|