Documentaion written more detailed

This commit is contained in:
Tobias Matthaiou 2019-08-21 00:36:20 +02:00
parent a551e9b857
commit f6e077a085
4 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,7 @@
Oxid SQL Logger
---------------
Oxid eShop SQL Logger
---------------------
Returns all SQL queries in the console browser.
Returns all SQL queries into console of a browser.
## Install
@ -9,11 +9,19 @@ composer require --dev tumtum/oxid-sql-logger
## Usage
Just set the function StartSQLLog() somewhere and from that point on all SQLs will be logged.
```php
\StartSQLLog();
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * FROM oxarticle WHERE oxprice < ? LIMIT 100', [49.99]);
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
\StopSQLLog();
```
## Screenshots
![Example all sqls](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-a.jpg)
![Example only one range](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-b.jpg)

View File

@ -5,6 +5,6 @@ require __DIR__ . '/../../../../source/bootstrap.php';
\StartSQLLog();
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * FROM oxarticle WHERE oxprice < ? LIMIT 100', [49.99]);
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
\StopSQLLog();

BIN
img/screenshot-a.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 KiB

BIN
img/screenshot-b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 KiB