Commit graph

264 commits

Author SHA1 Message Date
Ricordisamoa
4f72efe8d8 Remove excess newlines at the end of files
Many of them added with commit 776c865077

Change-Id: I481b15c45ead1f5f482e120cb40ea8f3297543cf
2015-09-27 00:02:05 +02:00
Reedy
776c865077 Re-enable Generic.Files.EndFileNewline.NotFound
Change-Id: Ib84ce8dc973f7e3fe688435a72f7936342b6f2dd
2015-09-26 15:58:53 +01:00
Aaron Schulz
0773b6c158 Fixed IDE errors due to SquidUpdate::newFromTitles
* Update phpdocs to allow Traversable for things like
  TitleArray::newFromResult, which are used and supported

Change-Id: I536f11969d3d4416c37b238c15ff930a770390bd
2015-09-24 11:15:53 -07:00
Aaron Schulz
25a44aa3e4 Added support for enqueueable DataUpdates
* Updates can now declare themselves as having enqueueUpdate()
  as an alternative to doUpdate(). This lets more expensive
  or slave lag producing updates use the job queue if desired.
* Added a $mode flag to DataUpdate::runUpdates() to prefer
  pushing jobs over calling doUpdate().
* Made page deletions defer deletion updates when possible.

Bug: T95501
Change-Id: Ic6f50f92768089ba0fbc223b8d178f5a91512959
2015-09-23 12:07:41 -07:00
Aaron Schulz
918fed0ab5 Moved LinksDeletionUpdate to a separate file
* Also removed unused updateCategoryCounts() method

Change-Id: I25f64d3771a23d18e7993433dab449adec375d9b
2015-09-22 11:07:47 -07:00
Aaron Schulz
d3f5c943ea Removed DeferredUpdates::addHTMLCacheUpdate()
* That method does not belong in DeferredUpdates
  as this class should agnostic to the work done

Change-Id: I8098ffb82bf9c33ccb48a31aa9dbad514e8724a8
2015-09-21 18:08:14 -07:00
Aaron Schulz
cc4ca3e86d Removed deprecated $wgDeferredUpdateList
Change-Id: I7072ad3b34dd9a0726df6d1c044616c3b4bcd79f
2015-09-21 16:30:16 -07:00
CSteipp
e412ff5ecc Revert "Enable users to watch category membership changes"
This reverts commit f6879ea16e.

Bug: T109638
Change-Id: I770d8d33a4cff3829bdea9a4df24de209cbe691b
2015-08-20 10:35:56 -07:00
Kai_WMDE
f6879ea16e Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
2015-08-13 17:58:06 +02:00
Aaron Schulz
4a3002063c Reduce RC table contention for file deletion
Bug: T98706
Change-Id: I13f12b93abccb348c7093c77c363a54a65b59142
2015-06-15 16:58:54 -07:00
Aaron Schulz
e2826974c6 Automatically deduplicate root jobs on insertion
* This makes lazyPush() simple to use in more cases

Change-Id: I22e74485eaf3120e5669c5ee55dc7ab7310d7300
2015-06-03 20:58:20 +00:00
Aaron Schulz
8dbfe9d339 DeferredUpdates doc comment tweak
Change-Id: Ib58bcb065ef7fac58c3c579eb0ca45e51ccdae11
2015-05-30 17:18:12 +00:00
Ori Livneh
6542746e6c Update context stats in SiteStatsUpdate
In addition to updating the database / memcached, make SiteStatsUpdate also
update the context stats object with the deltas it is processing.

Change-Id: Icc12c07ab4233e1105a402b80d290bdb64df6ea7
2015-05-28 21:38:57 -07:00
Aaron Schulz
99b05dcc6d Make sure $dbw is an object in DeferredUpdates::addUpdate()
Change-Id: Ib52574bc7f2e13bf06f595e349a7b3ccea425056
2015-05-20 23:06:05 -07:00
Aaron Schulz
04d11e6590 Make JobRunner flush DeferredUpdates after each job
Change-Id: Iff6625ddc04a15751d2bb07dc6558145e7ceb14a
2015-05-18 18:52:34 -07:00
Aaron Schulz
a17cdcbf5b Use lazyPush() instead of push() in a few places for jobs
Change-Id: I56661ea29988e4ee217a63f4c3ffcb78333cc454
2015-05-18 10:31:24 -07:00
Aaron Schulz
1e07005bce Removed SpecialStatistics query group; vslow is enough
Change-Id: I1841f5c64ebeeed7c3e54a11216add5c104ad69d
2015-04-09 11:39:15 -07:00
Aaron Schulz
3d4fc2b7a3 Cut down on deadlocks in invalidatePages()
Bug: T94992
Change-Id: I70f9d931b624e46ccc19f890d61de8d11326e686
2015-04-03 10:03:19 -07:00
jenkins-bot
4834574f63 Merge "Explicitly mark HTMLCacheUpdateJob jobs that are recursive for clarity" 2015-03-02 21:16:21 +00:00
Aaron Schulz
df5ef8b5d7 Removed doCascadeProtectionUpdates method to avoid DB writes on page views
* Use special prioritized refreshLinksJobs instead, which triggers when
  transcluded pages are changed
* Also added a triggerOpportunisticLinksUpdate() method to handle
  dynamic transcludes

bug: T89389
Change-Id: Iea952d4d2e660b7957eafb5f73fc87fab347dbe7
2015-02-22 13:36:13 -08:00
Aaron Schulz
5c16f0760f Explicitly mark HTMLCacheUpdateJob jobs that are recursive for clarity
Change-Id: I75dbe719ef034d4714d4d8262d1dee9fa78ba76b
2015-02-15 13:50:33 -08:00
Aaron Schulz
c3b4fabcd6 Made SqlDataUpdate use lazy DB connections
Change-Id: Ic041f620f27e1e8012586542ac6dc60657461d04
2015-01-14 02:40:32 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Ricordisamoa
2ae155da52 Fix phpcs errors in includes/
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines

Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
2015-01-08 20:15:07 +01:00
Aaron Schulz
4ff8136807 Removed remaining profile calls
Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
2015-01-08 02:49:33 -08:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
umherirrender
c0151eec5f Fix case of various newFromID/newFromId functions
User::newFromID -> User::newFromId
Revision::newFromID -> Revision::newFromId
RecentChange::newFromID -> RecentChange::newFromId

WikiPage::newFromId -> WikiPage::newFromID
Title::newFromId -> Title::newFromID

Change-Id: I310f26653613951e9b21ce915a92d205a87937f1
2014-12-10 19:40:27 +00:00
Chad Horohoe
90d90dad6e Remove hitcounters and associated code
The hitcounter implementation in MediaWiki is flawed
and needs removal. For proper metrics, it is suggested to use
something like Piwik or Google Analytics.

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: I0e5006a7e8a09c800f8fa4effa9399e8afdd7a57
2014-10-20 13:01:55 -07:00
Kevin Israel
e189306d51 Remove SquidUpdate::newFromLinksTo()
This has been broken since r9199 / e0ce5a322e41; a DB query error will occur
because the links table no longer exists, and even if the table were to
exist, the pl_* columns would not exist in that table.

There is no usage in core or Gerrit-hosted extensions.

Change-Id: I4922f85417bfb4d40f08662ba100ab5b78edd5fb
2014-10-06 18:19:10 +00:00
Aaron Schulz
12757b50f8 Removed $wgAntiLockFlags to unify the code paths
Change-Id: Ia709ccdc9addc55c99cbff21a5ff3009b5fbb53c
2014-10-03 10:42:17 -07:00
umherirrender
7c6a25856c Add missing @return to function docs
Change-Id: I45b9d02f94ecc58372268ec5e6a0b572a0b7e2a9
2014-08-23 23:14:57 +02:00
bsitu
70b012c595 Add support for adding deferred update within a deferred update
Under some configurations all Echo notifications are inserted
via a DeferredUpdate.  When an extension delays its own notification
trigger via DeferredUpdate as well the Echo notification will not
be run.

Change-Id: Ib40fcd4939ede5b0ff986ab109432630efd1be74
2014-08-20 22:13:11 +00:00
umherirrender
3b2b6a2773 Add missing @param to function docs
Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a
2014-08-14 20:22:52 +02:00
umherirrender
02dc9da399 Cleanup some docs (includes/[a-d])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I7b65fe04db431342cc58b469dc48f41a50c4e891
2014-07-24 19:42:45 +02:00
jenkins-bot
3ff03a1ccd Merge "Fixed spacing" 2014-07-24 12:49:17 +00:00
umherirrender
4ee680a8b3 Fixed spacing
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b
2014-07-24 11:53:04 +02:00
umherirrender
7ff005407e Remove colon after @deprecated/@param/@todo/@note
Change-Id: I4e66dad85eecf7e8e03ac760af900395e1bc11b6
2014-07-24 11:30:25 +02:00
jenkins-bot
c825102577 Merge "Made ViewCountUpdate do the page table updates in auto-commit mode" 2014-07-21 21:42:47 +00:00
Aaron Schulz
b8c038f678 Redo WhatLinksHere query and add a *_from_namespace field to link tables
* Also tweaked the query so MySQL avoids doing a page_name
  index scan when it should start with the link table index
* Added population script (triggered by update.php)
* Also removed uniqueness from some indexes where it is redundant
* Renamed two confusing variables

Bug: 60618
Change-Id: Icca99b6ae0ef76cb77695faf82c615516191da36
2014-07-21 12:04:56 -07:00
Aaron Schulz
74082ddb85 Made ViewCountUpdate do the page table updates in auto-commit mode
Change-Id: I3c52e61507eb8ccc7d46e70e24a2bdd573cf1fe2
2014-07-18 11:28:57 -07:00
Chad Horohoe
cd9dc7ef3f Database search fixes:
- Move filter() function and make it protected, nothing uses it
  outside database-backed searching
- Use per-backend legal search characters rather than assuming the
  static implementation is right

Change-Id: Ic2b830b56137b2dfe68b9b9c3de012151e716952
2014-06-20 13:43:36 -07:00
Aaron Schulz
fb9023bb2e Tweaked HTMLCacheUpdate immediate run treshold
Change-Id: I123c27862821e01fe232f55d984905fcda2a2498
2014-05-28 07:03:08 +00:00
jenkins-bot
bd2a78a159 Merge "Introducing pp_sortkey." 2014-04-24 21:42:07 +00:00
daniel
b1d6e78f74 Introducing pp_sortkey.
This adds the pp_sortkey column to the page_props table.

pp_sortkeys allows for top-k queries for pages, e.g.
the 100 pages with the most language links, etc. It is also
possible to query for exact values.

For now, pp_sortkey will contain pp_value's numeric value if
the value was set to a float, int or boolean.

Associated tasks:
* create a maintenance script for populating pp_sortkey. Tricky,
because when reading from the database, all values are strings.
* create an API module for querying pages by property value.

bug: 58032
Change-Id: I217c42656fb877ff35a36eb446a22bdaf119faac
2014-04-24 05:26:41 +00:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02:00
umherirrender
b45420410f Fixed some @params documentation (includes/*)
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: Iced714bca004756b461b66067a49a925a7e3b877
2014-04-19 22:22:20 +02:00
umherirrender
b9cd789fce docs: closure -> Closure; callback -> callable
Changed closure to capital word Closure in doc and type hint,
also changed callback in docs to callable

Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057
2014-04-19 08:43:31 +02:00
Chad Horohoe
d6c4ab9390 Get rid of Title::indexTitle and Title::getIndexTitle()
Nothing used them other than SearchUpdate, nor should they.
Move implementation there and make it private.

Change-Id: Iafc6f6d59487bd8c53cb99b2147815b2d70ead83
2014-04-16 11:03:42 -07:00
umherirrender
9c614ac02d Fixed some @params documentation
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.

Change-Id: I8c9f30128b46086064326708a4878228ba459447
2014-04-14 19:52:18 +00:00
umherirrender
d0e009a5f6 Avoid using raw sql in LinksUpdate.php
Now the IN-List is created by the database abstraction layer.

Change-Id: I5f4ed9213d04ae3eeef07c995e6ca91c0ee717b8
2014-04-09 17:03:43 +00:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
Alexandre Emsenhuber
449ee32451 Add missing line breaks to wfDebug() calls
Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.

Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642
2014-03-29 11:52:07 +01:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Alexandre Emsenhuber
8d701eeeea Remove trailing line breaks from wfDebugLog() messages
This is useless since the message is passed through trim() and a
line break is added afterwards.

Change-Id: I1a26b30a07f7c9c749fce5bb6b2b4b3d79901b7c
2014-02-04 22:16:13 +01:00
Aaron Schulz
9bb6465553 Made LinksUpdate::updateLinksTimestamp() use a more correct timestamp
* This can matter if page Y uses templates A and B, someone edits A,
  someone edits Y, someone edits B, an A-refreshLinks job on Y runs
  (using cache), then a B-refreshLinks job runs on Y. Previously,
  the later job could incorrectly no-op itself due to the high
  page_links_updated value on Y.

Change-Id: I984d2d1fc5aa075f3e3ead4921deaffbdc20e963
2014-01-30 14:13:12 -08:00
Brad Jorsch
a2120b0bd0 Make imagelinks work like templatelinks
Due to bug 17259 (which is fixed in a better way in Id44d566a),
imagelinks only records the redirect and not the actual image used when
an image redirect is referenced. This causes various problems, such as
cascading protection not working through image redirects.

It makes more sense for imagelinks to work like tempaltelinks, recording
both so that things like cascading protection don't have to care about
image redirects explicitly.

Comparing imagelinks to templatelinks also reveals a few places
(WikiPage::doDeleteUpdates, WikiPage::doCascadeProtectionUpdates) that
should be triggering a LinksUpdate if the image links changed.

Bug: 23002
Bug: 23542
Bug: 26503
Change-Id: I64fe7d25646cae2c8213211893c6f821f3504dbf
2014-01-07 23:13:43 +00:00
umherirrender
a33048bb8b Add sequence support for externallinks table
Database field el_id was added with
Ib6b0fc3736d173fa4ba7b786ecfc710b2f4711bb, but due to autoincrement in
mysql no sequence support was added.

For mysql this is a nop, it adds a field to the insert but that is null
and mysql autoincrement will fill it.
INSERT /* LinksUpdate::incrTableUpdate 127.0.0.1 */ IGNORE
  INTO `externallinks` (el_id,el_from,el_to,el_index)
VALUES
(NULL,'1610','http://de.wikipedia.org/wiki/Hauptseite','http://org.wikipedia.de./wiki/Hauptseite')

At least Oracle will need it

Bug: 58435
Change-Id: I3f68ea8d99c5450c0c66feeb1469ef0ee6cc4eab
2014-01-03 20:36:20 +01:00
Aaron Schulz
f8f452554e Added per-node sequential ID method and made SquidUpdate use it
* This replaces a live wmf hack

Change-Id: Ie01fd27386d5d7197968b6a8157b7220ba685f7b
2014-01-03 00:41:33 +00:00
Aaron Schulz
b57e457091 Added a page_links_updated column for job de-duplication
Change-Id: I74b6f507ef7371db92e0c3f058d38c0ca5dea9ef
2013-12-24 10:54:32 +00:00
Aaron Schulz
721731f43c Improved partitioning scheme for refreshLinks jobs
* The changes refreshLinks to handle both per-title (leaf) and backlink jobs.
  The base job now splits into some leaf jobs and a remaining partition job.
  The partition job does the same until there are only a small number
  of backlinks in the remaining range (so only leaf jobs are added).
  Since the leaf jobs are pushed first, this works well for FIFO queues
  to avoid bloating the queue. This also improves per-title job
  de-duplication, which isQueueDeprioritized() pretty much killed.
* The refreshLinks2 class is no longer used for new jobs.
* Fix process cache bug with JobQueueGroup::push with empty arrays.
* This adds a BacklinksJobUtils with helper functions for partitioning.
* RefreshLinksJob jobs now have a simple version parameter.
* Also moved refreshLinks2Job to its own file.

Change-Id: Id378d47df17248ae02938d5a54ef7ecd29efadbd
2013-11-26 16:02:44 -08:00
Siebrand Mazeland
7daa687d68 Update documentation and formatting for includes/deferred/
Change-Id: I56f35be6e549aec13c4fbad5ee6301aa29358031
2013-11-20 21:50:02 +00:00
Siebrand Mazeland
368a95dc65 Update formatting on includes/deferred/
Change-Id: Id3f143eae3781b26dcbc3ba63a566b7a6006c0cc
2013-11-20 21:48:48 +00:00
Tim Starling
64d0dc06a0 Move the DeferredUpdates hierarchy to its own directory
The grouping makes at least as much sense as job/, and certainly makes
more sense than cache/. With directories named after base classes, it is
fairly easy to tell what should go where. The grouping of
DeferredUpdates, DataUpdate and CallableUpdate would surely be
uncontroversial.

The move of SearchUpdate out of search/ demonstrates the conflict between
arrangement by module versus arrangement by type, which is the most
difficult design question here. I think arrangement by type is more
consistent with e.g. the arrangement of the core root, i.e. tests/,
resources/, maintenance/, etc. where a given feature will have its files
split up into a mostly type-based hierarchy.

I also tidied up AutoLoader.php by moving includes/content to the correct
location, sorted alphabetically by subdirectory.

Verified with AutoLoaderTest.

Change-Id: Ib369411d0caca38e72978084aa57348f1b892ed0
2013-11-04 10:32:40 +11:00