Bug #17693 [NoF]: issue with pre-commit hook script with filenames that start with v

From: Date: Wed, 25 Aug 2010 05:17:49 +0000
Subject: Bug #17693 [NoF]: issue with pre-commit hook script with filenames that start with v
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4666@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17693&edit=1 ID: 17693 Updated by: gsherwood@squiz.net Reported By: thomasfotherby+pear at gmail dot com Summary: issue with pre-commit hook script with filenames that start with v Status: No Feedback Type: Bug Package: PHP_CodeSniffer Operating System: CentOS 5.5 Package Version: 1.2.2 PHP Version: 5.3.2 Assigned To: squiz Roadmap Versions: New Comment: I have absolutely no idea why it is not working when we have the same PHP versions. I also have no idea why using double quotes makes it work for you. I'm obviously missing something but just don't know what. Previous Comments: ------------------------------------------------------------------------ [2010-08-23 12:00:17] tfotherby I tried your test script, i.e.: <?php $contents = 'Branches/Staging/classes/init-dbconnect.php Branches/Staging/classes/vps_handle_protx_response.php Branches/Staging/library/notifications.php Branches/Staging/top.php'; foreach (preg_split('/\v|\n/', $contents, -1, PREG_SPLIT_NO_EMPTY) as $path) { echo "$path\n"; } ?> It didn't work for me, I got a split at the "/v" string. This is the output: Branches/Staging/classes/init-dbconnect.php Branches/Staging/classes/ ps_handle_protx_response.php Branches/Staging/library/notifications.php Branches/Staging/top.php I think you are right and I must have a config issue rather than the phpcs code having a bug. I'm not sure what I have mis-configured though. I am sure I'm running PHP 5.3.2 > which php /usr/bin/php > /usr/bin/php --version PHP 5.3.2 (cli) (built: Jun 24 2010 17:19:48) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies ------------------------------------------------------------------------ [2010-08-23 01:52:56] squiz -Status: Feedback +Status: No Feedback Please re-open, or just comment, if you find any more information about your PHP version. ------------------------------------------------------------------------ [2010-08-16 03:38:21] squiz -Status: Assigned +Status: Feedback ------------------------------------------------------------------------ [2010-08-16 03:38:11] squiz Well this is pretty strange. I've tested a short script on 5.3.1 and 5.3.2: <?php $contents = 'Branches/Staging/classes/init-dbconnect.php Branches/Staging/classes/vps_handle_protx_response.php Branches/Staging/library/notifications.php Branches/Staging/top.php'; foreach (preg_split('/\v|\n/', $contents, -1, PREG_SPLIT_NO_EMPTY) as $path) { echo "$path\n"; } ?> This works fine. The \v character is not splitting on all "v" characters. Are you 100% sure your CLI version is 5.3.2? Also sure there isn't another older version of PHP on the server that SVN is using maybe? Might need to "which php" and check that the path is set correctly in the pre-commit hook. ------------------------------------------------------------------------ [2010-08-12 08:56:57] squiz -Status: Feedback +Status: Assigned ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=17693 -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17693&edit=1

« previous php.pear.bugs (#4666) next »