oxid-sql-logger/src/functions.php

44 regels
1016 B
PHP

2019-08-20 23:34:33 +02:00
<?php
2019-09-19 19:52:54 +02:00
2022-08-18 14:18:43 +02:00
use D3\OxidSqlLogger\OxidEsalesDatabase;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
2019-08-20 23:34:33 +02:00
/**
2019-09-19 19:52:54 +02:00
* @author Tobias Matthaiou <developer@tobimat.eu>
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
2019-08-20 23:34:33 +02:00
*/
2022-08-18 14:18:43 +02:00
/**
* @param string $message
*
* @throws DatabaseConnectionException
*/
function D3StartSQLLog($message = null) {
2022-08-18 14:18:43 +02:00
/** @var OxidEsalesDatabase $database */
$database = oxNew( OxidEsalesDatabase::class);
$database->d3EnableLogger($message);
2019-08-20 23:34:33 +02:00
}
2022-08-18 14:18:43 +02:00
/**
* @throws DatabaseConnectionException
*/
function D3StopSQLLog()
{
2022-08-18 14:18:43 +02:00
/** @var OxidEsalesDatabase $database */
$database = oxNew( OxidEsalesDatabase::class);
$database->d3DisableLogger();
2019-08-20 23:34:33 +02:00
}
2021-03-02 15:31:09 +01:00
2022-08-18 14:18:43 +02:00
/**
* @param $message
*
* @throws DatabaseConnectionException
*/
2021-03-02 15:31:09 +01:00
function D3AddSQLLogItem($message)
{
2022-08-18 14:18:43 +02:00
/** @var OxidEsalesDatabase $database */
$database = oxNew( OxidEsalesDatabase::class);
2021-03-02 15:31:09 +01:00
$database->d3GetLogger()->startQuery($message);
2022-08-18 14:18:43 +02:00
$database->d3GetLogger()->stopQuery();
2021-03-02 15:31:09 +01:00
}