pastuhov / yii2-query-tag
Query tag extension for Yii 2
Installs: 3 740
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.4
Requires (Dev)
- codeception/codeception: 2.1.8
- codeception/specify: 0.4.*
- codeception/verify: 0.2.*
- pastuhov/yii2-logstock: ~1.0.0
- yiisoft/yii2-codeception: 2.0.*
This package is not auto-updated.
Last update: 2024-11-10 04:07:01 UTC
README
Query tag extension for Yii 2
Do you use pgbabger
or pg_stat_statements
? And sometimes it can be difficult to understand which code generates the request? yii2-query-tag
will help!
Before:
SELECT * FROM page WHERE 1=1
After:
SELECT /* ExampleTest:11 UnitHelper:28 Step:218 */ * FROM page WHERE 1=1
Features
- Production ready/safe/tested
- Saves team time
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pastuhov/yii2-query-tag
or add
"require-dev": {
"pastuhov/yii2-query-tag": "~1.1.0"
...
to the require section of your composer.json
file.
Usage
Change your app config:
'components' => [ 'db' => [ 'class' => \yii\db\Connection::class, 'commandClass' => \pastuhov\querytag\Command::class, // <-- add this line
Advanced usage
Extend query tag command class:
namespace app\components; class Command extends \pastuhov\querytag\Command { public $customTag = 'master'; public $enabledTags = [ self::TAG_TYPE_CUSTOM, self::TAG_TYPE_TRACE, ]; }
Testing
./vendor/bin/codecept run
Security
If you discover any security related issues, please email pastukhov_k@sima-land.ru instead of using the issue tracker.