Documentaion written more detailed
This commit is contained in:
parent
1d627808d0
commit
cb35b27522
16
README.md
16
README.md
@ -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)
|
||||
|
||||
|
@ -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
BIN
img/screenshot-a.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 824 KiB |
BIN
img/screenshot-b.png
Normal file
BIN
img/screenshot-b.png
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user