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

Bug #20297 phar does not work when renamed it to phpcs
Submitted: 2014-06-15 21:47 UTC
From: ryuzee Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 2.0.0a2)
PHP Version: 5.5.9 OS: ubuntu 14.04
Roadmaps: (Not assigned)    
Subscription  


 [2014-06-15 21:47 UTC] ryuzee (Ryutaro Yoshiba)
Description: ------------ When I downloaded phpcs.phar and placeed it as /usr/local/bin/phpcs with executable permission and ran it, I got these errors as follows. It seems that this phar only works when the file name is phpcs.phar Actual result: -------------- PHP Warning: require_once(phar:///usr/local/bin/phpcs/CodeSniffer/CLI.php): failed to open stream: phar error: invalid url or non-existent phar "phar:///usr/local/bin/phpcs/CodeSniffer/CLI.php" in /usr/local/bin/phpcs on line 3 PHP Stack trace: PHP 1. {main}() /usr/local/bin/phpcs:0 PHP Fatal error: require_once(): Failed opening required 'phar:///usr/local/bin/phpcs/CodeSniffer/CLI.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/local/bin/phpcs on line 3 PHP Stack trace: PHP 1. {main}() /usr/local/bin/phpcs:0

Comments

 [2014-06-17 09:40 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
I've committed a fix here: https://github.com/squizlabs/PHP_CodeSniffer/commit/58a7f8bf79b9ad521939dd78 1a84c489b6d9f712 If you want to generate a new copy of the phar for testing: git clone git://github.com/squizlabs/PHP_CodeSniffer.git cd PHP_CodeSniffer php scripts/build-phar.php Now you'll have a phpcs.phar and phpcbf.phar in the PHP_CodeSniffer directory.