1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
mail.php
См. документацию.
1
<?php
2
3
/*
4
##############################################
5
# Bitrix Site Manager #
6
# Copyright (c) 2002 - 2007 Bitrix #
7
# https://www.bitrixsoft.com #
8
# mailto:admin@bitrixsoft.com #
9
##############################################
10
*/
11
12
require_once(
$_SERVER
[
"DOCUMENT_ROOT"
].
"/bitrix/modules/mail/classes/general/mail.php"
);
13
14
class
CMailbox
extends
CAllMailBox
15
{
16
public
static
function
CleanUp
()
17
{
18
$connection
=
\Bitrix\Main\Application::getConnection
();
19
$helper =
$connection
->getSqlHelper();
20
$days = COption::GetOptionInt(
"mail"
,
"time_keep_log"
,
B_MAIL_KEEP_LOG
);
21
22
$strSql =
"DELETE FROM b_mail_log WHERE DATE_INSERT < "
. $helper->addDaysToDateTime(-intval($days));
23
$connection
->query($strSql);
24
25
$mt = microtime(
true
);
26
$dbr =
$connection
->query(
"
27
SELECT MS.ID
28
FROM
29
b_mail_message MS
30
INNER JOIN b_mail_mailbox MB ON MS.MAILBOX_ID = MB.ID
31
WHERE
32
MB.MAX_KEEP_DAYS > 0
33
AND MS.DATE_INSERT < "
.$helper->addDaysToDateTime(
'-MB.MAX_KEEP_DAYS'
).
"
34
"
);
35
while
(
$ar
= $dbr->fetch())
36
{
37
CMailMessage::Delete
(
$ar
[
"ID"
]);
38
if
(microtime(
true
) - $mt > 10 * 1000)
39
break
;
40
}
41
42
\Bitrix\Mail\Helper\Message\MessageInternalDateHandler::clearStartInternalDate
();
43
44
return
"CMailbox::CleanUp();"
;
45
}
46
}
47
48
class
CMailUtil
extends
CAllMailUtil
49
{
50
public
static
function
IsSizeAllowed
($size)
51
{
52
global
$B_MAIL_MAX_ALLOWED
;
53
54
$dbConnection =
\Bitrix\Main\Application::getConnection
();
55
56
$B_MAIL_MAX_ALLOWED
= $dbConnection->getMaxAllowedPacket();
57
58
return
$B_MAIL_MAX_ALLOWED
> $size;
59
}
60
}
61
62
class
CMailMessage
extends
CAllMailMessage
63
{
64
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Mail\Helper\Message\MessageInternalDateHandler\clearStartInternalDate
static clearStartInternalDate(?int $mailboxId=null, ?string $dirMd5=null)
Определения
messageinternaldatehandler.php:115
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
CAllMailBox
Определения
mail.php:227
CAllMailMessage
Определения
mail.php:1320
CAllMailMessage\Delete
static Delete($id)
Определения
mail.php:2225
CAllMailUtil
Определения
mail.php:2813
CMailMessage
Определения
mail.php:63
CMailUtil
Определения
mail.php:49
CMailUtil\IsSizeAllowed
static IsSizeAllowed($size)
Определения
mail.php:50
CMailbox
Определения
mail.php:15
CMailbox\CleanUp
static CleanUp()
Определения
mail.php:16
$_SERVER
$_SERVER["DOCUMENT_ROOT"]
Определения
cron_frame.php:9
$B_MAIL_MAX_ALLOWED
global $B_MAIL_MAX_ALLOWED
Определения
mail.php:13
B_MAIL_KEEP_LOG
const B_MAIL_KEEP_LOG
Определения
constants.php:8
$ar
$ar
Определения
options.php:199
bitrix
modules
mail
classes
mysql
mail.php
Создано системой
1.14.0