1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
util.php
См. документацию.
1
<?php
2
3
class
CCloudUtil
4
{
10
public
static
function
URLEncode
(
$str
, $charset, $file_name =
false
)
11
{
12
$strEncodedURL =
''
;
13
14
if
($file_name)
15
{
16
$arUrlComponents = preg_split(
'#(://|/)#'
,
$str
, -1, PREG_SPLIT_DELIM_CAPTURE);
17
}
18
else
19
{
20
$arUrlComponents = preg_split(
'#(://|/|\\?|=|&)#'
,
$str
, -1, PREG_SPLIT_DELIM_CAPTURE);
21
}
22
23
foreach
($arUrlComponents as
$i
=> $part_of_url)
24
{
25
if
((intval(
$i
) % 2) == 1)
26
{
27
$strEncodedURL .= (string)$part_of_url;
28
}
29
elseif
(defined(
'BX_CLOUD_OLD_URL_ENCODE'
) && constant(
'BX_CLOUD_OLD_URL_ENCODE'
) ===
true
)
30
{
31
$strEncodedURL .= rawurlencode(\
Bitrix
\Main\Text\Encoding::convertEncoding(rawurldecode((
string
)$part_of_url),
LANG_CHARSET
, $charset));
32
}
33
else
34
{
35
$strEncodedURL .= rawurlencode(\
Bitrix
\Main\Text\Encoding::convertEncoding((
string
)$part_of_url,
LANG_CHARSET
, $charset));
36
}
37
}
38
39
return
$strEncodedURL;
40
}
41
46
public
static
function
gmtTimeToDateTime
(
$str
)
47
{
48
$timestamp = strtotime(
$str
.
'Z'
);
49
$datetime =
\Bitrix\Main\Type\DateTime::createFromTimestamp
($timestamp);
50
return
$datetime;
51
}
52
}
Bitrix\Main\Type\DateTime\createFromTimestamp
static createFromTimestamp($timestamp)
Определения
datetime.php:246
CCloudUtil
Определения
util.php:4
CCloudUtil\URLEncode
static URLEncode($str, $charset, $file_name=false)
Определения
util.php:10
CCloudUtil\gmtTimeToDateTime
static gmtTimeToDateTime($str)
Определения
util.php:46
$str
$str
Определения
commerceml2.php:63
LANG_CHARSET
const LANG_CHARSET
Определения
include.php:65
Bitrix
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$i
$i
Определения
factura.php:643
bitrix
modules
clouds
classes
general
util.php
Создано системой
1.14.0