8
0
Fork 0

adjust documentation

Dieser Commit ist enthalten in:
Daniel Seifert 2019-09-20 16:05:36 +02:00
Ursprung 7705abd09e
Commit bd16bf36cd
7 geänderte Dateien mit 25 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -6,8 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.1.0] - 2019-09-20
### Added
- add log message
- add position specifications of the calling source code
## [1.0.0] - 2019-07-21
available in tumtum/oxid-sql-logger package only
### Added
- Global function `StartSQLLog` and `StopSQLLog`

Datei anzeigen

@ -5,19 +5,19 @@ Returns all SQL queries into console of a Browser.
## Install
`composer require --dev tumtum/oxid-sql-logger`
`composer require --dev d3/oxid-sql-logger`
## Usage
Just set the function `StartSQLLog()` somewhere and from that point on all SQLs will be logged.
Just set the function `D3StartSQLLog()` somewhere and from that point on all SQLs will be logged.
```php
\StartSQLLog();
\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]);
\StopSQLLog();
\D3StopSQLLog();
```
## Screenshots
@ -25,9 +25,8 @@ $list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.
Browser:
![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.png)
CLI:
![Example CLI](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-cli.png)
![Example CLI](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-cli.jpg)

Datei anzeigen

@ -2,9 +2,18 @@
require __DIR__ . '/../../../../source/bootstrap.php';
\StartSQLLog();
\D3StartSQLLog('Query for 100 items cheaper than 49,99');
$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]);
\StopSQLLog();
\D3StopSQLLog();
// or
\D3StartSQLLog();
$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();

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 824 KiB

Nachher

Breite:  |  Höhe:  |  Größe: 166 KiB

Binäre Datei nicht angezeigt.

BIN
img/screenshot-cli.jpg Normale Datei

Binäre Datei nicht angezeigt.

Nachher

Breite:  |  Höhe:  |  Größe: 55 KiB

Binäre Datei nicht angezeigt.