Home > Archive > PHP Documentation > August 2006 > RE: [PHP-DOC] 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 |
RE: [PHP-DOC] cvs: phpdoc /scripts fix-whitespace.php
|
|
| Richard A. Quadling 2006-08-22, 6:57 pm |
| Just looking at this script.
I notice that even when there is no physical change to a file (binary
comparison results in identical file), the script still says the file
was changed and a datetimestamp update is performed (I'm on windows).
This means that files metadata are altered when they shouldn't be.
Really minor patch. May be better ways ...
Index: fix-whitespace.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D
RCS file: /repository/phpdoc/scripts/fix-whitespace.php,v
retrieving revision 1.1
diff -u -r1.1 fix-whitespace.php
--- fix-whitespace.php 22 Aug 2006 13:46:15 -0000 1.1
+++ fix-whitespace.php 22 Aug 2006 14:53:32 -0000
@@ -76,6 +76,8 @@
$tmp =3D '';
+ // Get a hash for the data that has been read.
+ $s_OrigMD5 =3D md5(implode('', $lines));
// start a state machine through the lines
@@ -207,7 +209,7 @@
} elseif (strlen($tmp) < 40) {
$log['error'][] =3D "ERROR: File ($file) is empty";
continue;
- } else {
+ } elseif (md5($tmp) !=3D=3D $s_OrigMD5) {
$fp =3D fopen($fullpath_file, 'w');
if ($fp) {
if (fwrite($fp, $tmp)) {
-----Original Message-----
From: Etienne Kneuss [mailto:colder@php.net]=20
Sent: 22 August 2006 14:46
To: phpdoc@lists.php.net
Subject: [PHP-DOC] cvs: phpdoc /scripts fix-whitespace.php=20
colder Tue Aug 22 13:46:15 2006 UTC
Added files: =20
/phpdoc/scripts fix-whitespace.php=20
Log:
Script fixing whitespaces issues to prepare the documentation to the
new style
=20
| |
| Etienne Kneuss 2006-08-22, 6:57 pm |
| Hi,
Thanks for the notice and for the idea!
Richard A. Quadling a écrit :
> Just looking at this script.
>
> I notice that even when there is no physical change to a file (binary
> comparison results in identical file), the script still says the file
> was changed and a datetimestamp update is performed (I'm on windows).
> This means that files metadata are altered when they shouldn't be.
>
> Really minor patch. May be better ways ...
>
--
Etienne Kneuss
http://www.colder.ch/
colder@php.net
|
|
|
|
|