Documentaion written more detailed
This commit is contained in:
parent
a551e9b857
commit
f6e077a085
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
|
## Install
|
||||||
|
|
||||||
@ -9,11 +9,19 @@ composer require --dev tumtum/oxid-sql-logger
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Just set the function StartSQLLog() somewhere and from that point on all SQLs will be logged.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
\StartSQLLog();
|
\StartSQLLog();
|
||||||
|
|
||||||
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
|
$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();
|
\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();
|
\StartSQLLog();
|
||||||
|
|
||||||
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
|
$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();
|
\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.
After Width: | Height: | Size: 754 KiB |
Loading…
Reference in New Issue
Block a user