Commit graph

22 commits

Author SHA1 Message Date
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
addshore
e6c0dcc02e Factor OldRevisionImporter & ImportableOldRevision out of WikiRevision
This is to be used within the FileImporter extension to allow
adding custom loggers to this import process.

Change-Id: Ib094d4829764ccc8e5bd2619fb827d701ae06d43
2018-02-20 10:26:47 +00:00
addshore
25fbfd9b9c Factor UploadRevisionImporter & ImportableUploadRevision out of WikiRevision
This is to be used within the FileImporter extension to allow
adding custom loggers to this import process.

Change-Id: I4a6c573fc0a69b06d696cd2afca9226fb492a9bc
2018-02-20 10:26:42 +00:00
addshore
e5879da149 Pass $key into CommentStore methods and use MediawikiServices
This allows CommentStore to be added to MediaWikiServices
without the need of an aditional Factory.

This change includes a compatability layer to allow the behaviour
from 1.30 to continue to be used while deprecated.

CommentStore::newKey has been deprecated.
Keys are now passed into the public methods of CommentStore
where needed.
The following CommentStore methods have had their signatures changed
to introduced a $key parameter, but when used in conjunction with
CommentStore::newKey behaviour will remain unchanged:
  * CommentStore::getFields
  * CommentStore::getJoin
  * CommentStore::getComment
  * CommentStore::getCommentLegacy
  * CommentStore::insert
  * CommentStore::insertWithTemplate

Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
2018-02-05 15:34:12 +00:00
Brad Jorsch
01a10dba5a Remove reference to deprecated IDatabase->nextSequenceValue()
The method was deprecated and made unnecessary in Ib308190c.

Change-Id: I1729ac0b3a88270a4c2f064187a2472112aaeb1e
2017-09-01 12:28:39 -04:00
Brad Jorsch
11cf01dd9a Add comment table and code to start using it
A subsequent patch will remove the old columns.

Bug: T166732
Change-Id: Ic3a434c061ed6e443ea072bc62dda09acbeeed7f
2017-08-30 15:05:00 +10:00
addshore
165041b4e4 Add @since tags to WikiRevision
Change-Id: I02005184d2cb3fa50aa0a51221b40e7c621219d2
2017-03-25 00:53:09 +00:00
addshore
417bd2905c Deprecate WikiRevision::$user
This was introduced in 436a028086
but was not used there.
It also currently looks unused.

We could go ahead and just remove this now, as anything that wants
to set the $user when the property is removed would still succeed.
But lets adhere to the deprecation policy here.

Change-Id: Id47323bb1ff480a16b46107825ed5f2f861ad976
2017-03-21 23:10:40 +00:00
addshore
213acd8202 Deprecate WikiRevision::$importer
This was introduced in 9b3128eb2b
but was not used there.
It also currently looks unused, even when grepping for possible
magic usages of 'importer' and "importer".

We could go ahead and just remove this now, as anything that wants
to set the $importer when the property is removed would still succeed.
But lets adhere to the deprecation policy here.

Change-Id: I5ac16dd87a95be6a3cdd4b16988d37d1d6104749
2017-03-21 23:10:19 +00:00
addshore
fd30abb59a Deprecate WikiRevision::$fileIsTemp and fix $isTemp
Cleanup from 43d5d3b682

This commit introduces both $fileIsTemp $isTemp
It would appear that the intent was to have one property here
and it looks like both of these are meant to do the same thing.

It also looks as if both public properties are actually unused
(only used by the getter and setters)

As isTemp will now sometimes return true line 766 $autoDeleteSource
will be true in new cases.
As a result $tmpFile->autocollect(); will be called in more cases

Change-Id: I8014172fb9fd7a0e4a89d0872bafdf6c50f92646
2017-03-21 23:09:34 +00:00
addshore
11ed7a4255 Mark WikiRevision methods as public
Change-Id: If252103d4850d9c9f0607a225b7d345736658cc7
2017-03-15 14:53:19 +00:00
Subin Siby
2c4a6cc7e0 Remove incorrect deprecated notice from function WikiRevision::getText()
WikiRevision::getText() was wrongly marked deprecated in 1.21.
This has been fixed.

Bug: T152282
Bug: T61113
Change-Id: I3f0e0f7fe38bd4e2001efbe17cdba6bcc90b036f
2016-12-27 13:25:47 +05:30
daniel
4aa4e7d796 Deprecfate WikiRevision::getText
Bug: T146162
Change-Id: I60249d687ac74baca146ed28d57c9a8ebcd79fba
2016-09-20 18:35:26 +02:00
Aaron Schulz
a4d737f229 Remove web-request usages of deadlockLoop()
Add comment discouraging use of the method. There are no problems
with deadlocks/timeouts in these code paths according to WMF logs.

Change-Id: I5b21cc423df584efa881361063000e01932cc2ea
2016-07-26 18:44:41 -07:00
Aaron Schulz
3261508d4d Cleanups to WikiRevision
* Check for blank $source variable more properly.
* Avoid use of ugly File::DELETE_SOURCE flag.
* Remove now-unused $flags parameter to uploadOld().

Change-Id: I6bc610cfead0036700b4f9a82e13f2bd9ab10f32
2016-03-23 17:27:23 +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
Andrew H
c812fa3cb3 Add maintenance script importTextFiles.php
importTextFiles.php can be used to import pages from text files
containing wikitext.

Also, added $userObj to WikiRevision so that it can accept a User
object instead of just a username.

This is a GCI task.

Change-Id: I20eaf2005bdd3d041f55d8c0b108f001c064d638
2016-01-08 00:57:11 +00:00
jenkins-bot
ab0a02f640 Merge "Restore changes to WikiRevision that were lost in cdeba4cfc7c" 2016-01-06 17:42:28 +00:00
This, that and the other
2cc10db042 Import: Try to stop revisions getting created with rev_page = 0
It seems that when two simultaneous imports of the same page are started,
we get into the situation where $pageId is 0 (or at least something that
is transformed to 0 when inserted into the DB).

I can't reproduce this locally, so I can't tell you *why* this is
happening. But what is important is to stop it from happening.

Bug: T18674
Change-Id: I79406a1ef8e5db9a31f029438f8132ef590216fe
2016-01-03 21:56:02 +00:00
This, that and the other
ec1b05892b Restore changes to WikiRevision that were lost in cdeba4cfc7
The commit cdeba4cfc7 unintentionally "reverted" part of commits
0623aeb922 and b14d581dab.

Change-Id: I19334bd6b871ab0555c6db873a67e935011aaaa4
2016-01-04 00:55:35 +11:00
georggi
37df726394 Import: Handle uploads with sha1 starting with 0 properly
Bug: T65010
Change-Id: Ia3f2d0b02a0f60df88f9466b66f1c7f5dc870c10
2016-01-03 14:00:35 +02:00
Krzysztof Zbudniewek
cdeba4cfc7 Split classes in Import.php into separate files
Bug: T122532
Change-Id: Ic4463ab8d3a7b2779f43efb92cb790dbc1d88064
2015-12-29 00:42:33 +01:00