Skip to content

Commit

Permalink
normalize filenames of maintenance scripts
Browse files Browse the repository at this point in the history
Use lowerCamelCase.php format for all files (per [[mw:CC#File_naming]]),
and make filenames more specific:
- clear_stats.php -> clearCacheStats.php
- clear_interwiki_cache.php -> clearInterwikiCache.php
- initStats.php -> initSiteStats.php
- proxy_check.php -> proxyCheck.php
- stats.php -> showCacheStats.php
- showStats.php -> showSiteStats.php

Also changed the class names accordingly (per [[mw:CC/PHP#Naming]]),
and make class names more specific:
- clear_stats -> ClearCacheStats
- InitStats -> InitSiteStats
- CacheStats -> ShowCacheStats
- ShowStats -> ShowSiteStats

Updated files that made references to the changed files/classes:
- DefaultSettings.php and SpecialBlockme.php (proxy_check.php -> proxyCheck.php)
- maintenance/showSiteStats.php (initStats.php -> initSiteStats.php)
- maintenance/README and docs/memcached.txt (stats.php -> showCacheStats.php)
- docs/maintenance.txt and docs/memcached.txt (clear_stats.php -> clearCacheStats.php)

Thanks Hashar for the initial help and encouragement :)

Change-Id: I60f76fc971e06e1b710dcda35f9c2d931b93bdd7
  • Loading branch information
waldyrious authored and reedy committed Mar 6, 2013
1 parent 3933910 commit 158bf7c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 16 deletions.
7 changes: 7 additions & 0 deletions RELEASE-NOTES-1.21
Expand Up @@ -291,6 +291,13 @@ changes to languages because of Bugzilla reports.
Vector extension (and possibly disable its features using config settings if
you don't want them).
* Experimental IBM DB2 support was removed due to lack of interest and maintainership
* BREAKING CHANGE: Filenames of maintenance scripts were standardized into lowerCamelCase
format, and made more explicit: clear_stats.php -> clearCacheStats.php;
clear_interwiki_cache.php -> clearInterwikiCache.php; initStats.php -> initSiteStats.php;
proxy_check.php -> proxyCheck.php; stats.php -> showCacheStats.php;
showStats.php -> showSiteStats.php. Class names were renamed accordingly:
clear_stats -> ClearCacheStats; InitStats -> InitSiteStats; CacheStats -> ShowCacheStats
ShowStats -> ShowSiteStats.

== Compatibility ==

Expand Down
2 changes: 1 addition & 1 deletion docs/maintenance.txt
Expand Up @@ -15,7 +15,7 @@ subdirectories, all of which have unique purposes.
level /maintenance directory.

Example:
php clear_stats.php
php clearCacheStats.php

The following parameters are available to all maintenance scripts
--help : Print a help message
Expand Down
4 changes: 2 additions & 2 deletions docs/memcached.txt
Expand Up @@ -237,9 +237,9 @@ Statistics:
controlled by: $wgStatsMethod
key: $wgDBname:stats:$key
ex: wikibd:stats:request_with_session
stores: counter for statistics (see maintenance/stats.php script)
stores: counter for statistics (see maintenance/showCacheStats.php script)
expiry: none (?)
cleared by: maintenance/clear_stats.php script
cleared by: maintenance/clearCacheStats.php script

User:
key: $wgDBname:user:id:$sId
Expand Down
2 changes: 1 addition & 1 deletion includes/DefaultSettings.php
Expand Up @@ -4406,7 +4406,7 @@
/** Port we want to scan for a proxy */
$wgProxyPorts = array( 80, 81, 1080, 3128, 6588, 8000, 8080, 8888, 65506 );
/** Script used to scan */
$wgProxyScriptPath = "$IP/maintenance/proxy_check.php";
$wgProxyScriptPath = "$IP/maintenance/proxyCheck.php";
/** */
$wgProxyMemcExpiry = 86400;
/** This should always be customised in LocalSettings.php */
Expand Down
2 changes: 1 addition & 1 deletion includes/specials/SpecialBlockme.php
Expand Up @@ -22,7 +22,7 @@
*/

/**
* A special page called by proxy_check.php to block open proxies
* A special page called by proxyCheck.php to block open proxies
*
* @ingroup SpecialPage
*/
Expand Down
4 changes: 2 additions & 2 deletions maintenance/README
Expand Up @@ -93,7 +93,7 @@ installations.
runJobs.php
Immediately complete all jobs in the job queue

stats.php
showCacheStats.php
Show all statistics stored in the cache

undelete.php
Expand All @@ -106,4 +106,4 @@ installations.
Update pages restriction to the new schema

userOptions.php
Change user options
Change user options
Expand Up @@ -28,7 +28,7 @@
*
* @ingroup Maintenance
*/
class clear_stats extends Maintenance {
class ClearCacheStats extends Maintenance {

public function __construct() {
parent::__construct();
Expand Down Expand Up @@ -56,5 +56,5 @@ public function execute() {
}
}

$maintClass = "clear_stats";
$maintClass = "ClearCacheStats";
require_once( RUN_MAINTENANCE_IF_MAIN );
File renamed without changes.
4 changes: 2 additions & 2 deletions maintenance/initStats.php → maintenance/initSiteStats.php
Expand Up @@ -30,7 +30,7 @@
*
* @ingroup Maintenance
*/
class InitStats extends Maintenance {
class InitSiteStats extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "Re-initialise the site statistics tables";
Expand Down Expand Up @@ -84,5 +84,5 @@ public function execute() {
}
}

$maintClass = "InitStats";
$maintClass = "InitSiteStats";
require_once( RUN_MAINTENANCE_IF_MAIN );
File renamed without changes.
4 changes: 2 additions & 2 deletions maintenance/stats.php → maintenance/showCacheStats.php
Expand Up @@ -28,7 +28,7 @@
*
* @ingroup Maintenance
*/
class CacheStats extends Maintenance {
class ShowCacheStats extends Maintenance {

public function __construct() {
$this->mDescription = "Show statistics from the cache";
Expand Down Expand Up @@ -102,5 +102,5 @@ public function execute() {
}
}

$maintClass = "CacheStats";
$maintClass = "ShowCacheStats";
require_once( RUN_MAINTENANCE_IF_MAIN );
6 changes: 3 additions & 3 deletions maintenance/showStats.php → maintenance/showSiteStats.php
Expand Up @@ -22,7 +22,7 @@
* @file
* @ingroup Maintenance
* @author Antoine Musso <hashar at free dot fr>
* Based on initStats.php by:
* Based on initSiteStats.php by:
* @author Brion Vibber
* @author Rob Church <robchur@gmail.com>
*
Expand All @@ -36,7 +36,7 @@
*
* @ingroup Maintenance
*/
class ShowStats extends Maintenance {
class ShowSiteStats extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "Show the cached statistics";
Expand Down Expand Up @@ -69,5 +69,5 @@ public function execute() {
}
}

$maintClass = "ShowStats";
$maintClass = "ShowSiteStats";
require_once( RUN_MAINTENANCE_IF_MAIN );

0 comments on commit 158bf7c

Please sign in to comment.