32 $path = preg_replace(
"/[\/\\\]+$/",
"",
$path);
40 if ($mode ==
"filesystem") {
41 return "./" . ILIAS_WEB_DIR .
"/" . $ilias->client_id;
44 return "../" . ILIAS_WEB_DIR .
"/" . $ilias->client_id;
46 return "./" . ILIAS_WEB_DIR .
"/" . $ilias->client_id;
55 return CLIENT_DATA_DIR;
60 $a_dir = trim($a_dir);
63 if (substr($a_dir, -1) ==
"/") {
64 $a_dir = substr($a_dir, 0, -1);
68 if (!(
$path = substr($a_dir, 0, strrpos($a_dir,
"/") - strlen($a_dir)))) {
74 return @mkdir($a_dir, fileperms(
$path));
79 $dirs =
array($a_dir);
80 $a_dir = dirname($a_dir);
82 while ($last_dirname != $a_dir) {
83 array_unshift($dirs, $a_dir);
84 $last_dirname = $a_dir;
85 $a_dir = dirname($a_dir);
89 $reverse_paths = array_reverse($dirs,
true);
91 foreach ($reverse_paths as
$key => $value) {
92 if ($found_index == -1) {
100 foreach ($dirs as $dirindex => $dir) {
102 if ($dirindex >= $found_index) {
103 if (!file_exists($dir)) {
104 if (strcmp(substr($dir, strlen($dir)-1, 1),
"/") == 0) {
107 $dir = substr($dir, 0, strlen($dir)-1);
109 if (!mkdir($dir, $umask)) {
113 } elseif (!is_dir($dir)) {
118 $umask = fileperms($dir);
127 if (!is_dir($a_dir) || is_int(strpos($a_dir,
".."))) {
131 $current_dir = opendir($a_dir);
140 while ($entryname = readdir($current_dir)) {
145 if (is_dir($a_dir .
"/" . $file) and ($file !=
"." and $file!=
"..")) {
146 self::delDir(${a_dir} .
"/" . ${
file});
147 } elseif ($file !=
"." and $file !=
"..") {
148 unlink(${a_dir} .
"/" . ${
file});
152 closedir($current_dir);
158 $current_dir = opendir($a_dir);
162 while ($entry = readdir($current_dir)) {
163 if (is_dir($a_dir .
"/" . $entry)) {
164 $dirs[$entry] =
array(
"type" =>
"dir",
"entry" => $entry);
166 if ($entry !=
"." && $entry !=
"..") {
167 $size = filesize($a_dir .
"/" . $entry);
168 $files[$entry] =
array(
"type" =>
"file",
"entry" => $entry,
176 return array_merge($dirs,
$files);
181 $temp_path = self::getDataDir() .
"/temp";
182 if (!is_dir($temp_path)) {
183 self::makeDir($temp_path);
185 $temp_name = tempnam($temp_path,
"tmp");
191 $temp_name = str_replace(
"\\",
"/", $temp_name);
static rename($source, $target)
static removeTrailingPathSeparators($path)
static getWebspaceDir($mode="filesystem")
static makeDirParents($a_dir)
Reload workbook from saved file
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'