PHP code example of d3 / oxid-sql-logger

1. Go to this page and download the library: Download d3/oxid-sql-logger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

d3 / oxid-sql-logger example snippets


\D3StartSQLLog('specific log message');

$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);

\D3StopSQLLog();

$this->SqlLoggerGUIHandlers = [
    \Monolog\Handler\BrowserConsoleHandler::class,
    \D3\OxidSqlLogger\Handler\d3FirePHPHandler::class
];

$this->SqlLoggerCLIHandlers = [
    ...
];

$this->d3FirePHPOptions = [
    \D3\OxidSqlLogger\Handler\d3FirePHPHandler::ADD_TRACE
];