f-prot isn't so open now, so might aswell not advertise it in DefaultSetttings under...
[lhc/web/wiklou.git] / includes / HistoryBlob.php
index 7887ff8..bb8ec5e 100644 (file)
@@ -1,5 +1,25 @@
 <?php
-
+/**
+ * Efficient concatenated text storage.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 /**
  * Base class for general text storage via the "object" flag in old_flags, or 
  * two-part external storage URLs. Used for represent efficient concatenated 
@@ -567,10 +587,11 @@ class DiffHistoryBlob implements HistoryBlob {
        function xdiffAdler32( $s ) {
                static $init;
                if ( $init === null ) {
-                       // The real Adler-32 checksum of this string is zero, so it 
-                       // initialises the state to the LibXDiff initial value.
                        $init = str_repeat( "\xf0", 205 ) . "\xee" . str_repeat( "\xf0", 67 ) . "\x02";
                }
+               // The real Adler-32 checksum of $init is zero, so it initialises the 
+               // state to zero, as it is at the start of LibXDiff's checksum 
+               // algorithm. Appending the subject string then simulates LibXDiff.
                if ( function_exists( 'hash' ) ) {
                        $hash = hash( 'adler32', $init . $s, true );
                } elseif ( function_exists( 'mhash' ) ) {