• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/diag/exceptionhandler.php
  • Класс: BitrixMainDiagExceptionHandler
  • Вызов: ExceptionHandler::initialize
public function initialize($exceptionHandlerOutputCreator, $exceptionHandlerLogCreator = null)
{
	if ($this->isInitialized)
		return;

	$this->initializeEnvironment();

	$this->handlerOutputCreator = $exceptionHandlerOutputCreator;
	$this->handlerLogCreator = $exceptionHandlerLogCreator;

	if ($this->catchOverflowMemory)
	{
		$this->memoryReserve = str_repeat('b', $this->memoryReserveLimit);
	}

	set_error_handler(array($this, "handleError"), $this->handledErrorsTypes);
	set_exception_handler(array($this, "handleException"));
	register_shutdown_function(array($this, "handleFatalError"));

	if ($this->debug)
	{
		assert_options(ASSERT_ACTIVE, 1);
		assert_options(ASSERT_WARNING, 0);
		assert_options(ASSERT_BAIL, 0);
		assert_options(ASSERT_CALLBACK, array($this, "handleAssertion"));
	}
	else
	{
		assert_options(ASSERT_ACTIVE, 0);
	}

	$this->isInitialized = true;
}