`yii\debug\Module::defaultVersion()` implementation #159

merged 2 commits into from Oct 26, 2016


None yet

3 participants


Extracted from yiisoft/yii2#12726

yii\debug\Module::defaultVersion() implemented to pick up 'yiisoft/yii2-debug' extension version

Is bugfix? no
New feature? yes
Breaks BC? no
Tests pass? yes
@klimov-paul klimov-paul added this to the 2.0.7 milestone Oct 25, 2016
@samdark samdark was assigned by klimov-paul Oct 25, 2016

Build fixed

@klimov-paul klimov-paul merged commit 66b092f into yiisoft:master Oct 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
@@ -17,6 +17,7 @@
"email": "qiang.xue@gmail.com"
+ "minimum-stability": "dev",
+ protected function defaultVersion()
+ {
+ $packageInfo = Json::decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'composer.json'));
+ $extensionName = $packageInfo['name'];
cebe Oct 26, 2016 Member

do we really need to read this from the composer.json file? The name is hardly ever going to change so it can just be hard coded here.

klimov-paul Oct 26, 2016 Member

I prefer more universal solution: it can be re-used as serves as a living example of possible implementation for developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment