yiisoft / yii-debug

Yii debug panel extension
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 15 forks source link

Add global constant `YII_DEBUG_VERSION` #266

Open vjik opened 1 month ago

vjik commented 1 month ago

This will allow us to check for existing Yii Debug in app. Also we will can check Yii Debug version via compare_version().

Constant may be used in package configurations instead of params, for example here: https://github.com/yiisoft/yii-view-renderer/blob/master/config/events-web.php

Constant may be defined in PHP file that include via "autoload" section in Composer.

xepozz commented 1 month ago

check for existing Yii Debug in app

What's the reason for it?

vjik commented 1 month ago

check for existing Yii Debug in app

What's the reason for it?

I was supposed to use it to add collectors, but existence is not enough, need check enabled also.

Constant may use to check whether code in package support current version Yii Debug or not.

xepozz commented 1 month ago

Package implemented collector must depend on specific version of yii-debug to check compatibility. Collectors must be loaded by Debug, not from userland

vjik commented 1 month ago

We don't can add yiisoft/yii-debug dependency to our packages. Constant helps to check Yii Debug version before configure events like here: https://github.com/yiisoft/yii-view-renderer/blob/master/config/events-web.php