Added missing GPLv2 headers in maintenance scripts.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 4 Sep 2012 16:48:17 +0000 (18:48 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 4 Sep 2012 16:48:17 +0000 (18:48 +0200)
- made file/class documentation more consistent
- contains a fix for Id7a04ff8 (2a7478b)

Change-Id: I5264105ce1b6ad86a9840e05be1af99f5d6e252a

maintenance/archives/upgradeLogging.php
maintenance/benchmarks/Benchmarker.php
maintenance/benchmarks/bench_HTTP_HTTPS.php
maintenance/benchmarks/bench_delete_truncate.php
maintenance/benchmarks/bench_if_switch.php
maintenance/benchmarks/bench_strtr_str_replace.php
maintenance/benchmarks/bench_utf8_title_check.php
maintenance/benchmarks/bench_wfIsWindows.php
maintenance/benchmarks/benchmarkHooks.php
maintenance/benchmarks/benchmarkPurge.php
maintenance/sql.php

index d406ea8..2c28011 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Replication-safe online upgrade script for log_id/log_deleted
+ * Replication-safe online upgrade for log_id/log_deleted fields.
  *
  * 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
 
 require( __DIR__ . '/../commandLine.inc' );
 
+/**
+ * Maintenance script that upgrade for log_id/log_deleted fields in a
+ * replication-safe way.
+ *
+ * @ingroup Maintenance
+ */
 class UpdateLogging {
 
        /**
@@ -63,21 +69,21 @@ CREATE TABLE $logging_1_10 (
   -- action field, but only the type controls categorization.
   log_type varbinary(10) NOT NULL default '',
   log_action varbinary(10) NOT NULL default '',
-  
+
   -- Timestamp. Duh.
   log_timestamp binary(14) NOT NULL default '19700101000000',
-  
+
   -- The user who performed this action; key to user_id
   log_user int unsigned NOT NULL default 0,
-  
+
   -- Key to the page affected. Where a user is the target,
   -- this will point to the user page.
   log_namespace int NOT NULL default 0,
   log_title varchar(255) binary NOT NULL default '',
-  
+
   -- Freeform text. Interpreted as edit history comments.
   log_comment varchar(255) NOT NULL default '',
-  
+
   -- LF separated list of miscellaneous parameters
   log_params blob NOT NULL,
 
@@ -124,7 +130,7 @@ EOT;
                $minTs = $this->dbw->selectField( $srcTable, 'MIN(log_timestamp)', false, __METHOD__ );
                $minTsUnix = wfTimestamp( TS_UNIX, $minTs );
                $numRowsCopied = 0;
-               
+
                while ( true ) {
                        $maxTs = $this->dbw->selectField( $srcTable, 'MAX(log_timestamp)', false, __METHOD__ );
                        $copyPos = $this->dbw->selectField( $dstTable, 'MAX(log_timestamp)', false, __METHOD__ );
@@ -137,7 +143,7 @@ EOT;
                                $percent = ( $copyPosUnix - $minTsUnix ) / ( $maxTsUnix - $minTsUnix ) * 100;
                        }
                        printf( "%s  %.2f%%\n", $copyPos, $percent );
-                       
+
                        # Handle all entries with timestamp equal to $copyPos
                        if ( $copyPos !== null ) {
                                $numRowsCopied += $this->copyExactMatch( $srcTable, $dstTable, $copyPos );
index 822f1a6..9901b37 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 /**
- * Create a doxygen subgroup of Maintenance for benchmarks
+ * Base code for benchmark scripts.
  *
  * 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
  */
 
 require_once( __DIR__ . '/../Maintenance.php' );
+
+/**
+ * Base class for benchmark scripts.
+ *
+ * @ingroup Benchmark
+ */
 abstract class Benchmarker extends Maintenance {
        private $results;
 
@@ -61,7 +67,7 @@ abstract class Benchmarker extends Maintenance {
 
                        $this->results[$bench_number] = array(
                                'function'  => $bench['function'],
-                               'arguments' => $bench['args'], 
+                               'arguments' => $bench['args'],
                                'count'     => $count,
                                'delta'     => $delta,
                                'average'   => $delta / $count,
index fb836c1..fa76ae2 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * This come from r75429 message
+ * Benchmark HTTP request vs HTTPS request.
+ *
+ * This come from r75429 message.
  *
  * 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
  */
 
 require_once( __DIR__ . '/Benchmarker.php' );
+
+/**
+ * Maintenance script that benchmarks HTTP request vs HTTPS request.
+ *
+ * @ingroup Benchmark
+ */
 class bench_HTTP_HTTPS extends Benchmarker {
 
        public function __construct() {
index 6e44864..a8e4627 100644 (file)
@@ -1,11 +1,33 @@
 <?php
 /**
+ * Benchmark SQL DELETE vs SQL TRUNCATE.
+ *
+ * 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
  * @ingroup Benchmark
  */
 
 require_once( __DIR__ . '/Benchmarker.php' );
 
+/**
+ * Maintenance script that benchmarks SQL DELETE vs SQL TRUNCATE.
+ *
+ * @ingroup Benchmark
+ */
 class BenchmarkDeleteTruncate extends Benchmarker {
 
        public function __construct() {
index 4a3abd4..1f590d4 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Benchmark if elseif... versus switch case.
+ *
  * This come from r75429 message
  *
  * This program is free software; you can redistribute it and/or modify
  */
 
 require_once( __DIR__ . '/Benchmarker.php' );
+
+/**
+ * Maintenance script that benchmark if elseif... versus switch case.
+ *
+ * @ingroup Maintenance
+ */
 class bench_if_switch extends Benchmarker {
 
        public function __construct() {
index cce7879..9fa7c8e 100644 (file)
@@ -1,5 +1,24 @@
 <?php
 /**
+ * Benchmark for strtr() vs str_replace().
+ *
+ * This come from r75429 message.
+ *
+ * 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
  * @ingroup Benchmark
  */
@@ -14,6 +33,11 @@ function bfNormalizeTitleStrReplace( $str ) {
     return str_replace( '_', ' ', $str );
 }
 
+/**
+ * Maintenance script that benchmarks for strtr() vs str_replace().
+ *
+ * @ingroup Benchmark
+ */
 class bench_strtr_str_replace extends Benchmarker {
 
        public function __construct() {
index d71f5f5..f598780 100644 (file)
@@ -1,5 +1,22 @@
 <?php
 /**
+ * Benchmark for using a regexp vs. mb_check_encoding to check for UTF-8 encoding.
+ *
+ * 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
  * @ingroup Benchmark
  */
@@ -7,8 +24,10 @@
 require_once( __DIR__ . '/Benchmarker.php' );
 
 /**
- * This little benchmark executes the regexp used in Language->checkTitleEncoding() and compares its execution time
- * against that of mb_check_encoding, if available.
+ * This little benchmark executes the regexp used in Language->checkTitleEncoding()
+ * and compares its execution time against that of mb_check_encoding, if available.
+ *
+ * @ingroup Benchmark
  */
 class bench_utf8_title_check extends Benchmarker {
 
index cd07fbd..8543982 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 /**
- * This come from r75429 message
+ * Benchmark for wfIsWindows().
+ *
+ * This come from r75429 message.
  *
  * 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
  */
 
 require_once( __DIR__ . '/Benchmarker.php' );
+
+/**
+ * Maintenance script that benchmarks wfIsWindows().
+ *
+ * @ingroup Benchmark
+ */
 class bench_wfIsWindows extends Benchmarker {
 
        public function __construct() {
index 508ea80..9d11601 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 /**
+ * Benchmark %MediaWiki hooks.
+ *
  * 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
 
 require_once( __DIR__ . '/Benchmarker.php' );
 
+/**
+ * Maintenance script that benchmarks %MediaWiki hooks.
+ *
+ * @ingroup Benchmark
+ */
 class BenchmarkHooks extends Benchmarker {
 
        public function __construct() {
index 4d36d26..7ef2116 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Squid purge benchmark script
+ * Benchmark for Squid purge.
  *
  * 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
 
 require_once( __DIR__ . '/Benchmarker.php' );
 
+/**
+ * Maintenance script that benchmarks Squid purge.
+ *
+ * @ingroup Benchmark
+ */
 class BenchmarkPurge extends Benchmarker {
 
        public function __construct() {
index c3d0e62..04e98d9 100644 (file)
@@ -18,6 +18,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  *
+ * @file
  * @ingroup Maintenance
  */