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

Bug #20323 PHPCS tries to load sniffs from hidden directories
Submitted: 2014-06-28 16:07 UTC
From: gboer Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.3)
PHP Version: 5.5.13 OS: Fedora 20
Roadmaps: (Not assigned)    
Subscription  


 [2014-06-28 16:07 UTC] gboer (Gijs Boer)
Description: ------------ Mac OS creates hidden directories like ".AppleDouble" and stores information about the files that it finds within the directory it is in. Each file it stores information about, is stored in the .AppleDouble directory with the exact same filename. So information about Test.php would be stored in .AppleDouble as Test.php as well. However, the information is stored in binary and is in no way actual PHP-code. When phpcs tries to load sniffs from a directory, it also scans these hidden Mac OS directories and tries to execute it, which it obviously can't. This results in rather ugly fatal errors after which phpcs is unable to continue. Expected result: ---------------- I expect phpcs to ignore hidden directories when trying to load sniffs, since this not only impacts directories that are created by Mac OS, but also svn and possibly other systems that create directories like this as well. Actual result: -------------- Errors like this: ????DEV?INO?SYN?SV~?DisallowHashCommentsSniff.phpF?F?F?n????Mn Fatal error: Class 'phpcs_Sniffs_Commenting_.AppleDouble_DisallowHashCommentsSniff' not found in /usr/share/pear/PHP/CodeSniffer.php on line 1053

Comments

 [2014-07-02 11:06 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/11ac602ef55af565585e048592 6bef14260276d0
 [2014-08-12 05:47 UTC] klausi (Klaus Purer)
This broke coding standard installations in the hidden .composer directory. Fix proposed here: https://github.com/squizlabs/PHP_CodeSniffer/pull/229