1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
virtual_io.php
См. документацию.
1<?
2include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/virtual_file.php");
3
7interface IBXVirtualIO
8{
9 function CombinePath();
10 function RelativeToAbsolutePath($relativePath);
11 function SiteRelativeToAbsolutePath($relativePath, $site = null);
19 function FileExists($path);
21 function GetFile($path);
22 function OpenFile($path, $mode);
24 function Delete($path);
25 function Copy($source, $target, $bRewrite = true);
26 function Move($source, $target, $bRewrite = true);
27 function Rename($source, $target);
28 function ClearCache();
29}
30
34interface IBXGetErrors
35{
36 function GetErrors();
37}
38
44{
45 private static $instance;
46 private $io;
47
48 public function __construct()
49 {
50 include_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/virtual_io_filesystem.php");
51 $this->io = new CBXVirtualIoFileSystem();
52 }
53
60 public static function GetInstance()
61 {
62 if (!isset(self::$instance))
63 {
64 $c = __CLASS__;
65 self::$instance = new $c;
66 }
67
68 return self::$instance;
69 }
70
78 public function CombinePath()
79 {
80 $numArgs = func_num_args();
81 if ($numArgs <= 0)
82 return "";
83
84 $arParts = array();
85 for ($i = 0; $i < $numArgs; $i++)
86 {
87 $arg = func_get_arg($i);
88 if (empty($arg))
89 continue;
90
91 if (is_array($arg))
92 {
93 foreach ($arg as $v)
94 {
95 if (empty($v))
96 continue;
97 $arParts[] = $v;
98 }
99 }
100 else
101 {
102 $arParts[] = $arg;
103 }
104 }
105
106 return $this->io->CombinePath($arParts);
107 }
108
115 public function RelativeToAbsolutePath($relativePath)
116 {
117 return $this->io->RelativeToAbsolutePath($relativePath);
118 }
119
120 public function SiteRelativeToAbsolutePath($relativePath, $site = null)
121 {
122 return $this->io->SiteRelativeToAbsolutePath($relativePath, $site);
123 }
124
131 public function GetPhysicalName($path)
132 {
133 return $this->io->GetPhysicalName($path);
134 }
135
136 public function GetLogicalName($path)
137 {
138 return $this->io->GetLogicalName($path);
139 }
140
147 public function ExtractNameFromPath($path)
148 {
149 return $this->io->ExtractNameFromPath($path);
150 }
151
158 public function ExtractPathFromPath($path)
159 {
160 return $this->io->ExtractPathFromPath($path);
161 }
162
167 public function ValidatePathString($path)
168 {
169 return $this->io->ValidatePathString($path);
170 }
171
177 {
178 return $this->io->ValidateFilenameString($filename);
179 }
180
186 {
187 return $this->io->RandomizeInvalidFilename($filename);
188 }
189
196 public function DirectoryExists($path)
197 {
198 return $this->io->DirectoryExists($path);
199 }
200
207 public function FileExists($path)
208 {
209 return $this->io->FileExists($path);
210 }
211
218 public function GetDirectory($path)
219 {
220 return $this->io->GetDirectory($path);
221 }
222
229 public function GetFile($path)
230 {
231 return $this->io->GetFile($path);
232 }
233
241 public function OpenFile($path, $mode)
242 {
243 return $this->io->OpenFile($path, $mode);
244 }
245
252 public function Delete($path)
253 {
254 return $this->io->Delete($path);
255 }
256
265 public function Copy($source, $target, $bRewrite = true)
266 {
267 return $this->io->Copy($source, $target, $bRewrite);
268 }
269
278 public function Move($source, $target, $bRewrite = true)
279 {
280 return $this->io->Move($source, $target, $bRewrite);
281 }
282
283 public function Rename($source, $target)
284 {
285 return $this->io->Rename($source, $target);
286 }
287
293 public function ClearCache()
294 {
295 $this->io->ClearCache();
296 }
297
304 public function CreateDirectory($path)
305 {
306 return $this->io->CreateDirectory($path);
307 }
308
314 public function GetErrors()
315 {
316 return $this->io->GetErrors();
317 }
318}
$path
Определения access_edit.php:21
Определения virtual_io.php:44
GetPhysicalName($path)
Определения virtual_io.php:131
RandomizeInvalidFilename($filename)
Определения virtual_io.php:185
__construct()
Определения virtual_io.php:48
OpenFile($path, $mode)
Определения virtual_io.php:241
CombinePath()
Определения virtual_io.php:78
Delete($path)
Определения virtual_io.php:252
ValidateFilenameString($filename)
Определения virtual_io.php:176
Rename($source, $target)
Определения virtual_io.php:283
GetDirectory($path)
Определения virtual_io.php:218
DirectoryExists($path)
Определения virtual_io.php:196
FileExists($path)
Определения virtual_io.php:207
Move($source, $target, $bRewrite=true)
Определения virtual_io.php:278
GetFile($path)
Определения virtual_io.php:229
static GetInstance()
Определения virtual_io.php:60
SiteRelativeToAbsolutePath($relativePath, $site=null)
Определения virtual_io.php:120
RelativeToAbsolutePath($relativePath)
Определения virtual_io.php:115
GetErrors()
Определения virtual_io.php:314
ClearCache()
Определения virtual_io.php:293
ExtractNameFromPath($path)
Определения virtual_io.php:147
GetLogicalName($path)
Определения virtual_io.php:136
ExtractPathFromPath($path)
Определения virtual_io.php:158
ValidatePathString($path)
Определения virtual_io.php:167
Copy($source, $target, $bRewrite=true)
Определения virtual_io.php:265
CreateDirectory($path)
Определения virtual_io.php:304
$filename
Определения file_edit.php:47
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения virtual_io.php:35
Определения virtual_io.php:8
GetPhysicalName($path)
OpenFile($path, $mode)
Delete($path)
ValidateFilenameString($filename)
Rename($source, $target)
GetDirectory($path)
DirectoryExists($path)
FileExists($path)
Move($source, $target, $bRewrite=true)
GetFile($path)
SiteRelativeToAbsolutePath($relativePath, $site=null)
RelativeToAbsolutePath($relativePath)
ExtractNameFromPath($path)
GetLogicalName($path)
ExtractPathFromPath($path)
ValidatePathString($path)
Copy($source, $target, $bRewrite=true)
CreateDirectory($path)
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$i
Определения factura.php:643
$site
Определения yandex_run.php:614