Commit graph

54 commits

Author SHA1 Message Date
Zoranzoki21
074baa39f5 Convert HTTP links to MediaWiki.org to HTTPS
Bug: T189687
Change-Id: I846d3a74f617b98c8237f2a8babef85c6c128b14
2018-04-04 18:36:10 +00:00
Umherirrender
055b5f82b7 Search for Hooks::runWithoutAbort in maintenance/findHooks.php
Follows-up I94c7ab656bd1a04

Change-Id: I63faf3071e55bb0ba5aba1536bc98a969fb564af
2018-02-10 22:25:40 +01:00
Umherirrender
ad776c7d5f Use ::class to resolve class names in maintenance scripts
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
2018-01-23 17:40:16 +00:00
Bryan Davis
9e34eeff23 Maintenance: add fatalError() method
Deprecate the second argument to Maintenance::error() in favor of a new
Maintenance::fatalError() method. This is intended to make it easier to
review flow control in maintenance scripts.

Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
2017-11-21 21:34:16 -07:00
Umherirrender
750ac4dd89 Fix findHooks.php
Add the test entry point, because it contains documented hooks.
Filter out empty args, coming from trailing commas

Removed empty lines from hooks.txt, because a hook must be one block
without newlines between.

Change-Id: I71e0625da96cad03f5e38a000fa61d1d2bdac8ef
2017-09-17 10:54:49 +02:00
rlot
99800a9e03 Removed deprecated ContentHandler hooks.
Plus removed unused "ContentHandler::runLegacyHooks"

Bug: T154498
Change-Id: Ie398fd4e06d3e286fe8e24112d0c8b4ac7d883dc
2017-01-18 21:19:17 +00:00
Fomafix
202f695f67 Update weblinks in comments from HTTP to HTTPS
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.

Also update some defect links.

Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
2016-11-07 15:24:46 +01:00
Chad Horohoe
79806e91e7 Support short array syntax in findHooks.php
Bug: T135257
Change-Id: I19d4f073ff730821230ccb28d29df303fbaccbc2
2016-06-13 21:23:39 +00:00
Chad Horohoe
f2c9dea186 Don't look for hooks in .php5 files that don't exist
Change-Id: I4c9cdcdebfe4e617361f723df624c1d3e3096e6e
2016-06-12 18:53:08 -07:00
umherirrender
cf80990274 findHooks.php: Work also on .inc and .php5
Also fix the use of RecursiveDirectoryIterator::SKIP_DOTS, which was 
passed to the wrong constructor.

Follows I29280dfe629126c71adfb65ac1a59394bc459dc4
Follows I6c01b8768f9f70152e320d254f8025a0ffde8c62

Change-Id: Ib35ca10b809afd5f6da80cd5edd1a71479c917a7
2016-06-12 18:09:31 +02:00
Chad Horohoe
4b4ace0e00 findHooks.php: Only look at PHP files, not silly things
Change-Id: I29280dfe629126c71adfb65ac1a59394bc459dc4
2016-06-10 13:43:58 -07:00
Chad Horohoe
3e7c21a7c1 Remove useless sort parameter to printArray()
All callers use the default

Change-Id: If2a5cd64242f3b3d9ad9a99f5af7fb5b93438e8e
2016-06-10 13:43:58 -07:00
Timo Tijhof
bb585ff9dc findHooks.php: Use recursive directory iterator
The following dirs were not previously included:
* includes/compat/
* includes/compat/normal/
* includes/composer/
* includes/config/
* includes/db/loadbalancer/
* includes/debug/logger/
* includes/filebackend/filejournal/
* includes/filebackend/lockmanager/
* includes/jobqueue/aggregator/
* includes/jobqueue/jobs/
* includes/jobqueue/utils/
* includes/libs/
* includes/objectcache/
* includes/pager/
* includes/poolcounter/
* includes/profiler/output/
* includes/profiler/
* includes/registration/
* includes/templates/
* includes/tidy/
* includes/title/
* includes/utils/iterators/
* includes/widget/
* maintenance/ subdirectories

Change-Id: I6c01b8768f9f70152e320d254f8025a0ffde8c62
2016-03-01 22:57:19 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Ricordisamoa
179017976f Make maintenance/findHooks.php pass again
* check 4 new paths

* strip 'NormalizeMessageKey' hook from docs/hooks.txt,
  last call was removed in 1ea4f23b05

Change-Id: Id36ab478b94f74be451cae848d5ef2a318d23040
2016-02-13 20:06:12 +00:00
Max Semenik
59db24e90b Use addDescription() instead of accessing mDescription directly
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
2016-01-30 01:28:32 -08:00
umherirrender
a628f41ea9 Allow findHooks.php to compare parameter references of hooks
Check if all hooks in hooks.txt have a &, if the code also have & and
the other way round.

Fix all hooks in hooks.txt to have a clean run of the script.

Change-Id: I1b45253e20dc310e825cdc17e0e2e9c8fb315bab
2015-11-18 16:19:34 +00:00
umherirrender
01eb216c5f Allow findHooks.php to compare parameter count of hooks
All wrong hook documentation gets fixed with own patch sets:
https://gerrit.wikimedia.org/r/#/q/project:mediawiki/core+branch:master+topic:hooksdoc,n,z
and Iae0285b1a39cf851aaaa735cb22e95c839813997

Change-Id: I5991c4f0ff3ed1fbad18a38169a62d406bf4d105
2015-11-18 10:13:07 +00:00
Amir E. Aharoni
34a07796c1 Make lines short to pass phpcs in files under maintenance/
Bug: T102614
Change-Id: Ieab3773a9ff8328e3672478a82ab31d8710fa8e2
2015-09-27 15:48:56 +00:00
Kunal Mehta
8fb5c380bd findHooks: Exit with a status code of 1 if issues are found
This will make it easier to have something automated run
the script since it can check the exit code of the script
so see if any issues were found.

Also fixed the printing of "Looks good!", which wasn't happening
if a hook was being ignored. The check for ignoring was moved up
and out of the print logic.

Change-Id: I683a131a804d4fac9a21f386b2756e050219d392
2015-07-18 21:44:27 +00:00
Ricordisamoa
6eafdc2a0b Add missing paths to maintenance/findHooks.php
* includes/changetags/
  created with commit 5c4681012e

* includes/exception/
  created with commit 557af13086

* includes/password/
  created with commit 95a8974c6b

Change-Id: Ie9047a1849969a078465d1e81ada16a7b47bc0ec
2015-07-18 10:06:17 +02:00
Chad Horohoe
c33f4de066 Profile all external HTTP requests from MW
Change-Id: Ie980b080da2ef21ec7d9fc32f1accc55710de140
2015-03-03 20:54:30 -08:00
Ricordisamoa
76d6e49145 Make maintenance/findHooks.php check includes/mail/
bf8810d6bc split some
email-related code into a separate directory, along
with references to five hooks, thus listed as
'Documented and not found':
* AbortTalkPageEmailNotification
* AlternateUserMailer
* SendWatchlistEmailNotification
* UpdateUserMailerFormattedPageStatus
* UserMailerChangeReturnPath

Change-Id: I7601ea2f2b0c4c9dcf802114e464be9af88fa5cb
2014-12-09 19:35:25 +00:00
Kevin Israel
1adb05fe9c findHooks.php, importSiteScripts.php: Use format=json
* Also added query continuation support to findHooks.php.
* Also fixed query continuation support in importSiteScripts.php
  (broken by 2b3f4d821c).

Change-Id: I7ef62d370f5e2f598ac4c5857ac0dbf3ee4c8fa2
2014-09-21 03:08:44 +00:00
Kunal Mehta
ff1429fc7e Update findHooks.php and move MonoBook hook out of docs/hooks.txt
Added includes/skins/ to the list of directories and removed
the skins that were moved out of core.

The MonoBook hook is moved to skins/MonoBook in Ieb85b4bed.

Change-Id: Ie8ad1eb694575b8e1485177e2d14f2a9dcab179d
2014-08-24 15:09:01 -07:00
umherirrender
cd80906d4a Change @return to start with type
MediaWiki default is "@return type Description", so set a type after
return and start the description with a capital letter. Also use the
more common spelling of boolean.

See http://phpdoc.org/docs/latest/references/phpdoc/tags/return.html for
more about @return

Change-Id: I4e5198822fe92836f9cef9918a9fc1a1a1e0a043
2014-08-20 20:35:41 +02:00
umherirrender
6b4c44c2db Add missing @param to function docs
Change-Id: Ib26407bc55dff7969d8a3b1e2ae51751b202d8fb
2014-08-18 16:24:59 +00:00
umherirrender
25971af694 Cleanup some docs (maintenance)
- Fixed spacing inside docs
- Makes beginning of @param/@return in capital

Change-Id: I864b8b3f1f67e34e369aba7aadaf87e7752c894d
2014-08-09 22:08:40 +02:00
Kevin Israel
b540fa2f28 Add includes/page/ to findHooks.php
Follows-up 32ac391331.

Change-Id: I07dc1e9ad7bcb0b7e5477eb17e6e625f6ec625e2
2014-06-24 00:20:45 -04:00
Kevin Israel
a46de31d8f Fix capitalization of "MonoBook" in findHooks.php
Follows-up ec1ccf4367 and 4bbd1c44d9.

Change-Id: I08e4ff78b2bb2a5582ef612b0248e0c7338436a2
2014-06-20 22:47:27 -04:00
Kevin Israel
4bbd1c44d9 Fix some findHooks.php errors
* Correct typo in docs/hooks.txt.
* Add a few directories.

Left unfixed is "Undocumented: Special{$this->getName()}BeforeFormDisplay",
which will be addressed separately.

Change-Id: I4fda8960642c23500bd20e0b89c1d1327456313b
2014-06-20 21:35:51 -04:00
Siebrand Mazeland
f2f31fadc7 Update formatting in maintenance/ (2/4)
Change-Id: I2b791d3bff0de464b6bdaaeae0622c065389c31c
2014-04-23 20:08:42 +02:00
Siebrand Mazeland
80dd48238c Pass phpcs-strict on maintenance/ (5/8)
Change-Id: I156b547b504e7267ea43deff4b8c532635508e81
2014-04-23 11:27:25 +02:00
umherirrender
e78776373e Fixed some @params documentation (maintenance)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I727deec35a712de0f0c676cc87dfa661f1ee965b
2014-04-17 22:48:32 +02:00
Alexandre Emsenhuber
117e179fd6 Fix path in findHooks.php script
Follow-up I4c8a2b421 (9ffd4f0): include/job was renamed
to include/jobqueue.

bug: 63186
Change-Id: I47d594adbaa6d944724a32ca1c701a5bfd297205
2014-03-27 20:10:29 +01:00
jenkins-bot
807d510ad7 Merge "Ignore testRunLegacyHooks in findHooks.php" 2014-01-24 21:09:33 +00:00
jenkins-bot
fe7c34eebd Merge "Use a better regular expression to find documented hooks in findHooks.php" 2013-12-26 18:09:25 +00:00
Alexandre Emsenhuber
4a5f18e58d Use a better regular expression to find documented hooks in findHooks.php
Added a ":" after the second quote so that only strings in the form
'Hook': are matched, otherwise the line 1172 of hooks.txt provoques the
the following message:
Documented and not found: value
because the line starts with 'value'.

Change-Id: I1d603e3fa10dcabf25e31f6a71aad233571738b5
2013-12-15 14:55:39 +01:00
Alexandre Emsenhuber
6044732ff8 Add one more missing directory to findHooks.php
Change-Id: If2aa0ff952a565b4171bc0955619cb9d86a87221
2013-12-15 13:49:56 +01:00
Kunal Mehta
99d385eced Add missing directories to findHooks.php
Change-Id: I60ead68fbed90ee6d94ee6d7d783f69bf1aaa9f8
2013-12-15 13:42:06 +01:00
Kunal Mehta
afd167a150 Ignore testRunLegacyHooks in findHooks.php
Not a real hook, just used for testing.

Change-Id: I8944deb63f5f9926342aaee7cf8f990cfb7c5eb3
2013-12-13 20:56:02 -08:00
umherirrender
0bc583af2c Move closing parenthesis from multi line if and function to own line
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.

Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
2013-12-01 21:39:00 +01:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
umherirrender
926d2ee143 Remove spaces between parentheses in function calls
Change-Id: If8ec665a01b566fa5189dfcc810b2d9a17f371e1
2013-03-17 16:13:22 +01:00
Alexandre Emsenhuber
21484ddacf Updates findHooks.php for ContentHandler changes.
- Added includes/content/ to the list of directories
- Added ContentHandler::runLegacyHooks() to the list of functions that run hooks

Change-Id: I1f21af71443468232b4bc119454f1c93ad343137
2012-10-12 08:32:13 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Alexandre Emsenhuber
02e15ebd0b Improve documentation of maintenance scripts.
Change-Id: I0e2869970c46f4fd14b792f2978cc1ba9d8550be
2012-07-10 18:50:19 +02:00
Alexandre Emsenhuber
129d23aacc Added missing directories to findHooks.php and missing quote in hooks.txt that made LoginAuthenticateAudit show up as undocumented when running findHooks.php 2012-02-12 19:18:36 +00:00
Sam Reed
f3f180850a Fixing up undefined types in maintenance documentation 2012-02-09 21:08:06 +00:00