1C-Bitrix
25.700.0
Toggle main menu visibility
Титульная страница
Пространства имен
Пространства имен
Члены пространств имен
Указатель
$
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Функции
_
a
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
Переменные
$
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
v
w
Перечисления
a
b
c
d
e
f
g
l
m
n
o
p
r
s
t
u
v
w
Элементы перечислений
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Структуры данных
Структуры данных
Алфавитный указатель структур данных
Иерархия классов
Поля структур
Указатель
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Функции
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Переменные
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Перечисления
Элементы перечислений
Файлы
Файлы
Список членов всех файлов
Указатель
$
(
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
б
в
к
л
о
п
с
т
ю
Функции
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Переменные
$
(
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
б
в
к
л
о
п
с
т
ю
Блог
Хостинг
1C-Bitrix
Пространства имен
Структуры данных
Файлы
Файлы
bitrix
modules
abtest
advertising
b24connector
bitrixcloud
bizproc
bizprocdesigner
blog
calendar
catalog
clouds
cluster
conversion
currency
eshopapp
fileman
form
forum
highloadblock
iblock
idea
im
landing
ldap
learning
lists
location
mail
main
messageservice
mobileapp
perfmon
photogallery
pull
report
rest
sale
scale
search
security
sender
seo
socialnetwork
socialservices
statistic
storeassist
subscribe
support
translate
lib
cli
controller
index
io
archiver.php
csvfile.php
directory.php
file.php
filesystemhelper.php
path.php
text
ui
Update
componentbase.php
config.php
error.php
file.php
filter.php
ierrorable.php
permission.php
settings.php
warning.php
meta
.settings.php
autoload.php
default_option.php
include.php
options.php
prolog.php
translate_tools.php
ui
vote
webservice
wiki
workflow
Список членов всех файлов
Примеры
•
Указатель
Структуры данных
Пространства имен
Файлы
Функции
Переменные
Перечисления
Элементы перечислений
Страницы
Загрузка...
Поиск...
Не найдено
file.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Translate\IO;
4
5
use Bitrix\Translate;
6
use Bitrix\Main;
7
8
9
class
File
extends
Main\IO\File
implements
Translate\IErrorable
10
{
11
// trait implements interface Translate\IErrorable
12
use
Translate\Error
;
13
23
public
static
function
generateTemporalFile
(
string
$prefix,
string
$suffix =
'.tmp'
,
int
$timeToLive = 3): self
24
{
25
$tempDir = \CTempFile::getDirectoryName($timeToLive,
array
($prefix, \uniqid($prefix,
true
)));
26
Path::checkCreatePath
($tempDir.
'/'
);
27
28
$hash
= \str_pad(\dechex(\crc32($tempDir)), 8,
'0'
, STR_PAD_LEFT);
29
$fileName
= \uniqid(
$hash
.
'_'
,
false
). $suffix;
30
31
return
new
static
($tempDir.
$fileName
);
32
}
23
public
static
function
generateTemporalFile
(
string
$prefix,
string
$suffix =
'.tmp'
,
int
$timeToLive = 3): self {
…
}
33
39
public
function
openLoad
(): bool
40
{
41
if
($this->
isExists
())
42
{
43
$this->
open
(
Main
\
IO
\FileStreamOpenMode::READ);
44
}
45
46
return
$this->
isExists
() && $this->
isReadable
();
47
}
39
public
function
openLoad
(): bool {
…
}
48
54
public
function
openWrite
(): bool
55
{
56
$this->
open
(
Main
\
IO
\FileStreamOpenMode::WRITE);
57
58
return
$this->
isWritable
();
59
}
54
public
function
openWrite
(): bool {
…
}
60
61
69
public
function
read
(
int
$length): string
70
{
71
if
(\feof($this->filePointer))
72
{
73
return
''
;
74
}
75
76
return \fread($this->filePointer, $length);
77
}
69
public
function
read
(
int
$length): string {
…
}
78
88
public
function
write
(
string
$content
): int
89
{
90
if
(!\is_resource($this->filePointer))
91
{
92
throw
new
Main\IO\FileNotOpenedException
($this->
getPath
());
93
}
94
95
$length = \fwrite($this->filePointer,
$content
);
96
if
($length ===
false
)
97
{
98
throw
new
Main\IO\IoException
(
"Cannot write file"
);
99
}
100
101
return
$length;
102
}
88
public
function
write
(
string
$content
): int {
…
}
103
110
public
function
close
(): void
111
{
112
if
(!\is_resource($this->filePointer))
113
{
114
@\fflush($this->filePointer);
115
}
116
117
parent::close();
118
119
@clearstatcache(
true
, $this->
getPhysicalPath
());
120
}
110
public
function
close
(): void {
…
}
121
}
9
class
File
extends
Main\IO\File
implements
Translate\IErrorable
{
…
};
$hash
$hash
Определения
ajax_redirector.php:8
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\IO\File\open
open($mode)
Определения
file.php:25
Bitrix\Main\IO\File\isReadable
isReadable()
Определения
file.php:194
Bitrix\Main\IO\File\isWritable
isWritable()
Определения
file.php:184
Bitrix\Main\IO\File\isExists
isExists()
Определения
file.php:50
Bitrix\Main\IO\FileNotOpenedException
Определения
filenotopenedexception.php:6
Bitrix\Main\IO\FileSystemEntry\getPath
getPath()
Определения
filesystementry.php:80
Bitrix\Main\IO\FileSystemEntry\getPhysicalPath
getPhysicalPath()
Определения
filesystementry.php:142
Bitrix\Main\IO\IoException
Определения
ioexception.php:9
Bitrix\Translate\IO\File\read
read(int $length)
Определения
file.php:69
Bitrix\Translate\IO\File\generateTemporalFile
static generateTemporalFile(string $prefix, string $suffix='.tmp', int $timeToLive=3)
Определения
file.php:23
Bitrix\Translate\IO\File\write
write(string $content)
Определения
file.php:88
Bitrix\Translate\IO\File\close
close()
Определения
file.php:110
Bitrix\Translate\IO\File\openLoad
openLoad()
Определения
file.php:39
Bitrix\Translate\IO\File\openWrite
openWrite()
Определения
file.php:54
Bitrix\Translate\IO\Path\checkCreatePath
static checkCreatePath(string $path)
Определения
path.php:180
$content
$content
Определения
commerceml.php:144
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Translate\IErrorable
Определения
ierrorable.php:8
Bitrix\Main\File
Определения
Image.php:9
Bitrix\Main\IO
Определения
directory.php:3
Bitrix\Main
$fileName
$fileName
Определения
quickway.php:305
bitrix
modules
translate
lib
io
file.php
Создано системой
1.14.0