adjust documentation
This commit is contained in:
@ -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:
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||
|
|
||||||
CLI:
|
CLI:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 824 KiB After Width: | Height: | Size: 166 KiB |
Binary file not shown.
BIN
img/screenshot-cli.jpg
Normal file
BIN
img/screenshot-cli.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
Reference in New Issue
Block a user