Improve profileinfo.php documentation
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 17 Aug 2018 14:58:57 +0000 (15:58 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 17 Aug 2018 15:00:45 +0000 (16:00 +0100)
* Move $wgEnableProfileInfo to DefaultSettings.php

* The configuration variable to enable the entry point was added
  together with the entry point itself in 9af3c09e5c (r9846).

* Change references to StartProfiler.php to refer to LocalSettings.php,
  given the former is deprecated since 1.31 (I4e8dd9558132).

Change-Id: I7ca5f2deace8645f06bebd915630c1de05c84bc5

docs/scripts.txt
includes/DefaultSettings.php
profileinfo.php

index dff428c..b2501d4 100644 (file)
@@ -28,19 +28,9 @@ Primary scripts:
     that points to the search engines of the wiki.
 
   profileinfo.php
     that points to the search engines of the wiki.
 
   profileinfo.php
-    Allow users to see the profiling information that are stored in the
-    database.
-
-    To save the profiling information in the database (required to use this
-    script), you have to modify StartProfiler.php to use the Profiler class and
-    not the stub profiler which is enabled by default.
-    You will also need to set $wgProfiler['output'] to 'db' in LocalSettings.php
-    to force the profiler to save the informations in the database and apply the
-    maintenance/archives/patch-profiling.sql patch to the database.
-
-    To enable the profileinfo.php itself, you'll need to set $wgDBadminuser
-    and $wgDBadminpassword in your LocalSettings.php, as well as $wgEnableProfileInfo
-    See also https://www.mediawiki.org/wiki/Manual:Profiling .
+    Simple interface for displaying request profiles that were stored in the
+    database. For more information, see the documentation in that file, and at
+    https://www.mediawiki.org/wiki/Manual:Profiling.
 
   thumb.php
     Script used to resize images if it is configured to be done when the web
 
   thumb.php
     Script used to resize images if it is configured to be done when the web
index e81909a..736e319 100644 (file)
@@ -6411,6 +6411,13 @@ $wgDeprecationReleaseLimit = false;
  */
 $wgProfiler = [];
 
  */
 $wgProfiler = [];
 
+/**
+ * Allow the profileinfo.php entrypoint to be used.
+ *
+ * @since 1.5.0
+ */
+$wgEnableProfileInfo = false;
+
 /**
  * Only record profiling info for pages that took longer than this
  * @deprecated since 1.25: set $wgProfiler['threshold'] instead.
 /**
  * Only record profiling info for pages that took longer than this
  * @deprecated since 1.25: set $wgProfiler['threshold'] instead.
index 8bd37dd..264b5eb 100644 (file)
@@ -1,6 +1,17 @@
 <?php
 /**
 <?php
 /**
- * Show profiling data.
+ * Simple interface for displaying request profile data stored in
+ * the wikis' primary database.
+ *
+ * See also https://www.mediawiki.org/wiki/Manual:Profiling.
+ *
+ * To add profiling information to the database:
+ *
+ * - set $wgProfiler['class'] in LocalSetings.php to a Profiler class other than ProfilerStub.
+ * - set $wgProfiler['output'] to 'db' to force the profiler to save its the
+ *   information in the database.
+ * - apply the maintenance/archives/patch-profiling.sql patch to the database.
+ * - set $wgEnableProfileInfo to true.
  *
  * Copyright 2005 Kate Turner.
  *
  *
  * Copyright 2005 Kate Turner.
  *
@@ -32,7 +43,6 @@ define( 'MW_NO_SESSION', 'warn' );
 
 ini_set( 'zlib.output_compression', 'off' );
 
 
 ini_set( 'zlib.output_compression', 'off' );
 
-$wgEnableProfileInfo = false;
 require __DIR__ . '/includes/WebStart.php';
 
 header( 'Content-Type: text/html; charset=utf-8' );
 require __DIR__ . '/includes/WebStart.php';
 
 header( 'Content-Type: text/html; charset=utf-8' );
@@ -155,7 +165,7 @@ $dbr = wfGetDB( DB_REPLICA );
 if ( !$dbr->tableExists( 'profiling' ) ) {
        echo '<p>No <code>profiling</code> table exists, so we can\'t show you anything.</p>'
                . '<p>If you want to log profiling data, enable <code>$wgProfiler[\'output\'] = \'db\'</code>'
 if ( !$dbr->tableExists( 'profiling' ) ) {
        echo '<p>No <code>profiling</code> table exists, so we can\'t show you anything.</p>'
                . '<p>If you want to log profiling data, enable <code>$wgProfiler[\'output\'] = \'db\'</code>'
-               . ' in your StartProfiler.php and run <code>maintenance/update.php</code> to'
+               . ' in LocalSettings.php and run <code>maintenance/update.php</code> to'
                . ' create the profiling table.'
                . '</body></html>';
        exit( 1 );
                . ' create the profiling table.'
                . '</body></html>';
        exit( 1 );