For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > August 2006 > cvs: phpdoc /scripts fix-whitespace.php









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: phpdoc /scripts fix-whitespace.php
Etienne Kneuss

2006-08-22, 6:57 pm

colder Tue Aug 22 17:23:08 2006 UTC

Modified files:
/phpdoc/scripts fix-whitespace.php
Log:
Don't touch files that need no modifications

http://cvs.php.net/viewvc.cgi/phpdo...2&diff_format=u
Index: phpdoc/scripts/fix-whitespace.php
diff -u phpdoc/scripts/fix-whitespace.php:1.1 phpdoc/scripts/fix-whitespace.php:1.2
--- phpdoc/scripts/fix-whitespace.php:1.1 Tue Aug 22 13:46:15 2006
+++ phpdoc/scripts/fix-whitespace.php Tue Aug 22 17:23:07 2006
@@ -17,7 +17,7 @@
| Etienne Kneuss <colder@php.net> |
+----------------------------------------------------------------------+

- $Id: fix-whitespace.php,v 1.1 2006/08/22 13:46:15 colder Exp $
+ $Id: fix-whitespace.php,v 1.2 2006/08/22 17:23:07 colder Exp $
*/

if (PHP_SAPI !== 'cli') {
@@ -73,6 +73,7 @@
}

$lines = file($fullpath_file);
+ $hash = sha1(implode('', $lines));

$tmp = '';

@@ -207,7 +208,7 @@
} elseif (strlen($tmp) < 40) {
$log['error'][] = "ERROR: File ($file) is empty";
continue;
- } else {
+ } elseif (sha1($tmp) !== $hash) {
$fp = fopen($fullpath_file, 'w');
if ($fp) {
if (fwrite($fp, $tmp)) {
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com