From 6ff469e57f663474d5f203b468b0eca9b88a4345 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 17 Aug 2018 15:58:57 +0100 Subject: [PATCH] Improve profileinfo.php documentation * 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 | 16 +++------------- includes/DefaultSettings.php | 7 +++++++ profileinfo.php | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/scripts.txt b/docs/scripts.txt index dff428c5a2..b2501d4469 100644 --- a/docs/scripts.txt +++ b/docs/scripts.txt @@ -28,19 +28,9 @@ Primary scripts: 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 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e81909abb5..736e31911d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6411,6 +6411,13 @@ $wgDeprecationReleaseLimit = false; */ $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. diff --git a/profileinfo.php b/profileinfo.php index 8bd37dd4cb..264b5eb1c3 100644 --- a/profileinfo.php +++ b/profileinfo.php @@ -1,6 +1,17 @@ tableExists( 'profiling' ) ) { echo '

No profiling table exists, so we can\'t show you anything.

' . '

If you want to log profiling data, enable $wgProfiler[\'output\'] = \'db\'' - . ' in your StartProfiler.php and run maintenance/update.php to' + . ' in LocalSettings.php and run maintenance/update.php to' . ' create the profiling table.' . ''; exit( 1 ); -- 2.20.1