Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Request #20050 Composer installed phpcs does no report version
Submitted: 2013-08-22 19:48 UTC
From: pbuyle Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.4.6)
PHP Version: 5.4.9 OS: GNU/Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 - 17 = ?

 
 [2013-08-22 19:48 UTC] pbuyle (Pierre Buyle)
Description: ------------ When installing PHP CodeSniffer via Composer using "squizlabs/php_codesniffer", the installed phpcs command does not report its version when using the --version option. Test script: --------------- Use this composer.json file: { "name": "test/phpcs", "description": "phpcs tesy", "config": { "bin-dir": "bin" }, "require-dev": { "squizlabs/php_codesniffer": "1.4.6", } } And run `composer install` then `bin/phpcs --version` Expected result: ---------------- PHP_CodeSniffer version 1.4.6 (stable) by Squiz Pty Ltd. (http://www.squiz.com.au) Actual result: -------------- PHP_CodeSniffer version @package_version@ (@package_state@) by Squiz Pty Ltd. (http://www.squiz.com.au)

Comments

 [2013-08-23 06:05 UTC] squiz (Greg Sherwood)
-Type: Bug +Type: Feature/Change Request
I am aware of this, and it is obviously caused by the fact that PEAR can do variable replacements of code on install while composer never really "installs" anything for PHPCS; it just clones the report and moves a script. When composer support was added, I did ask if anyone knew how to write an install/upgrade script to modify the version information, but nobody did. If you happen to know, please point me in the right direction because the composer docs were not much help at the time. I'm also changing this to a feature request, although I am not ignoring it. PHPCS still functions correctly and it is actually a PEAR package and not designed for composer.
 [2013-08-23 06:06 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Verified -Assigned To: +Assigned To: squiz
 [2013-09-06 04:54 UTC] squiz (Greg Sherwood)
-Status: Verified +Status: Closed
Determined there was no good way to do this via a script, and it still wouldn't work when running from a git clone, so I am now storing version info in 2 places. Fix committed to git repo. Works for dev-master etc now, and will work from 1.4.7 onwards. https://github.com/squizlabs/PHP_CodeSniffer/commit/44b0a9e6f4403655b2bc763a76 7823c4421bd92d