Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
healerearlysessionstart.php
1
<?php
2
3
namespace
Bitrix\Main\Session\Legacy
;
4
5
use
Bitrix\Main\Session\KernelSessionProxy
;
6
use
Bitrix\Main\Session\SessionInterface
;
7
use
Bitrix\Main\SystemException
;
8
9
final
class
HealerEarlySessionStart
10
{
11
public
function
process
(
SessionInterface
$kernelSession)
12
{
13
if
(($kernelSession instanceof
KernelSessionProxy
) && $kernelSession->isActive() && !$kernelSession->
isStarted
())
14
{
15
session_write_close();
16
17
$exception =
new
SystemException
(
18
'Attention! The session_start function was called before the Bitrix Kernel was started. '
.
19
'The session will be closed to avoid errors. It\'s strongly recommended to avoid session usage before initializing the Bitrix Kernel.'
20
);
21
trigger_error($exception->getMessage(), E_USER_DEPRECATED);
22
$application = \Bitrix\Main\Application::getInstance();
23
$exceptionHandler = $application->getExceptionHandler();
24
$exceptionHandler->writeToLog($exception);
25
}
26
}
27
}
Bitrix\Main\Session\KernelSessionProxy
Definition
kernelsessionproxy.php:6
Bitrix\Main\Session\Legacy\HealerEarlySessionStart
Definition
healerearlysessionstart.php:10
Bitrix\Main\Session\Legacy\HealerEarlySessionStart\process
process(SessionInterface $kernelSession)
Definition
healerearlysessionstart.php:11
Bitrix\Main\SystemException
Definition
exception.php:8
Bitrix\Main\Session\SessionInterface
Definition
sessioninterface.php:6
Bitrix\Main\Session\SessionInterface\isStarted
isStarted()
Bitrix\Main\Session\Legacy
Definition
healerearlysessionstart.php:3
modules
main
lib
session
legacy
healerearlysessionstart.php
Создано системой
1.10.0