adjust documentation
Dieser Commit ist enthalten in:
Ursprung
7705abd09e
Commit
bd16bf36cd
|
@ -6,8 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [1.0.0] - 2019-07-21
|
||||||
|
|
||||||
|
available in tumtum/oxid-sql-logger package only
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Global function `StartSQLLog` and `StopSQLLog`
|
- Global function `StartSQLLog` and `StopSQLLog`
|
||||||
|
|
11
README.md
11
README.md
|
@ -5,19 +5,19 @@ Returns all SQL queries into console of a Browser.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
`composer require --dev tumtum/oxid-sql-logger`
|
`composer require --dev d3/oxid-sql-logger`
|
||||||
|
|
||||||
## Usage
|
## 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
|
```php
|
||||||
\StartSQLLog();
|
\D3StartSQLLog('specific log message');
|
||||||
|
|
||||||
$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 oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
|
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
|
||||||
|
|
||||||
\StopSQLLog();
|
\D3StopSQLLog();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
@ -25,9 +25,8 @@ $list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.
|
||||||
Browser:
|
Browser:
|
||||||
|
|
||||||
![Example all sqls](https://raw.githubusercontent.com/TumTum/oxid-sql-logger/master/img/screenshot-a.jpg)
|
![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:
|
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)
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,18 @@
|
||||||
|
|
||||||
require __DIR__ . '/../../../../source/bootstrap.php';
|
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);
|
$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]);
|
$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äre Datei nicht angezeigt.
Nachher Breite: | Höhe: | Größe: 55 KiB |
Binäre Datei nicht angezeigt.
Laden…
In neuem Issue referenzieren