Commit graph

196 commits

Author SHA1 Message Date
Federico Leva
e40b0455ca Use a faster 7z command line by default
In tests with one typical XML dump, -mx=4 looked much better than -mx=5
in terms of CPU cost, with negligible losses in compression.
Merged downstream by Wikia: https://github.com/Wikia/app/pull/6118

It probably makes sense to explicitly adopt a default suitable for XML
dumps; but later this should be configurable in scripts etc. (T78669).

Change-Id: I07ab5f93ecd6d706460691db5181de89ef31cbea
2015-01-30 15:10:55 +00: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
daniel
da3c19fb17 Change position of <model> and <format> tags in XML dumps.
Bug: 72417
Change-Id: I1d11ce8147cf0bf0018e3931202f533afd4ea93e
2014-10-31 16:49:58 +00:00
umherirrender
799ba118a3 Remove XmlDumpWriter::schemaVersion (deprecated 1.20)
Change-Id: I725d19e46d4728d46d58bfbd3d5a9ad54c4df24a
2014-09-26 14:34:36 -07:00
Kevin Israel
3daf61814d Remove redundant $db->resultObject() calls
DatabaseBase::query() already passes the value returned by the
database driver (usually an object or resource for SELECT queries)
through $db->resultObject(). There is no need to pass it through
the method a second time to get a ResultWrapper.

Change-Id: I5d34ab2bffb7f236d2f824b4ef0e8670f89d4599
2014-09-19 20:35:55 +00:00
Stephan Gambke
f09e458d39 Fix for Ia9baaf0b: Make previously public variables public again
Change Ia9baaf0b changed the visibility of member variables (many of which are not
otherwise exposed, e.g. by a method) and by that introduced a major API change
breaking extensions.

This patch explicitly marks affected variables as public again, keeping the intent
of the original patch of making phpcs-strict pass on includes/ directory.

Bug: 67522
Bug: 67984
Change-Id: I498512b2a1e615365bb477c1fd210aaa3241ca03
2014-08-29 23:01:53 +02:00
Reedy
3c86ddfba5 Add dbname to XML database dump "siteinfo"
Bug: 68686
Change-Id: I1d93a91e62dfde6c9ab4fac887d6fb2b33e36a72
2014-07-30 19:00:11 +00:00
Reedy
38d580f8d7 Add comment about how to deploy new xml schema XSD files
Change-Id: I5a20594befaa5afcab44960fd892c6f798c3d729
2014-07-27 18:52:24 +01:00
withoutaname
344e6c7b75 Move function xmlsafe() from Export.php to OAI extension
Exporting function from Export.php.

Change-Id: I82a78ff7a34402f2cc065643d90b064b996c525d
2014-07-19 23:26:23 +02:00
daniel
ee0ff556d4 Introduce ContentHandler::exportTransform()
ContentHandler::exportTransform() allows content handlers to apply
transformations upon export, such as conversion of legacy formats or
filtering of internal data.

Note that the transformation is applied to serialized content, since
the exporter will generally not unserialize the content blob to an
intermediate form before writing it to the dump. Implementations
may choose to unserialy, then transform and re-serialize.

Bug: 65256
Change-Id: Ic55a8bd8bea13041000b176c7c02c7c5ced76f6d
2014-05-20 19:21:49 +02:00
Siebrand Mazeland
a7fbdd6503 Make phpcs-strict pass on includes/ (7/7)
Change-Id: Ia9baaf0b3cdbe1a3c6b50ef8c4fe86fead88f909
2014-05-15 20:07:09 +02:00
umherirrender
192a9d021c Fixed some @params documentation (includes/[Export.php|Import.php])
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: I32ed752d23088f6203462134b2af57c6f06a4de5
2014-04-23 11:30:40 +02:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
umherirrender
725d9d125d Removed unneeded spaces and colons in @param and friends
Also 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: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
2014-04-08 16:02:49 +00:00
Siebrand Mazeland
7a635c5dfd Try to make a dent in CodeSniffer reports on includes/ (1)
Change-Id: Iaf3120b4e32cc5835ef9ed86236d98679e2b87fa
2014-03-23 01:29:41 +00:00
Ladsgroup
1ba0445c12 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 2

Change-Id: I3be61fe3dfb502cc20180486eb1a8016eac151df
2014-03-12 23:24:03 +00:00
umherirrender
65a4ae9fe9 Change Title::getInterwiki() in conditions to Title::isExternal()
Change-Id: Icce26e6194ae96f262029554e05b49117d5e112e
2014-01-02 11:59:10 +01:00
umherirrender
5ca5672aac Fixed spacing
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs

Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
2013-12-01 20:58:51 +01:00
umherirrender
db24b10ca8 Use lowercase key words
Change-Id: I57569b7082a0decc8128ecadd8ec5d1a5c327673
2013-11-23 15:56:42 +01:00
Aaron Schulz
3b5770835d Use getFileContents() instead of incorrect file system call to fetch file contents.
Change-Id: I2b9be4165ae85c52ff9a9b68b9d71ec011a6c5b4
2013-06-10 10:10:40 -07:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
jenkins-bot
419786beb0 Merge "remove not needed return and break" 2013-02-10 13:02:07 +00:00
umherirrender
3779d16d59 remove not needed return and break
break after throw is not executed

return; at end of function is not needed

Change-Id: I7c1c1799f78da11b7607a753d4f215c4547f0428
2013-02-09 23:55:46 +01:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
c16e1a4490 TRUE, FALSE and NULL must be lowercase
From phpcs

Change-Id: I09672012be28ae3985702e314442db00d154de24
2013-02-09 21:10:44 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
Alexandre Emsenhuber
ca4489c3e3 Don't use isset() to check whether an existing variable is null
Change-Id: I7b4207e91b6fa33ba31b1308f5e71f923def687e
2013-01-01 22:13:30 +01:00
daniel
400dfb3550 Don't fail on incomplete row info when exporting.
This allows XmlDumpWriter to output rows that are missing some
information without triggering php warnings.

This fixes warnings caused by the OAI extension when using
XmlDumpWriter::writeRevision without setting the row's
rev_parent_id field.

Generally, it seems convenient to allow optional fields to be unset
instead of skipping them if they are empty, but requiering them to be
set.

Change-Id: I246ba3a899bd9e833232444a11ac63e1b0225ab6
2012-10-29 22:47:19 +01:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
daniel
f3dc35246e Updated export XSD to include model and format.
Change-Id: Iffd89862c76f850950e13e56b8d6a9c855230fed
2012-10-05 12:05:16 +02:00
umherirrender
fe136d618d Remove pass-by-reference from WikiExporter constructor
The pass-by-reference is a left over from PHP 4 times.

This avoids:
Strict Standards: Only variables should be passed by reference in
\includes\api\ApiQuery.php on line 523

Change-Id: I8c9afcd9f7631bbb0bdb9ea608339bbbd5726a26
2012-09-23 20:53:30 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
umherirrender
4f7f226299 (bug 37249) validate export-demo.xml against current export.xsd
Change-Id: I9031a1b3338fe69b8860caf9cac59a66e0e09fc1
2012-07-13 19:34:38 +00:00
Antoine Musso
d5737f8f17 update @param @return doc in several files
Change-Id: I0e23227330f90dc4121fd2a313d2e9a33c3c97a7
2012-07-10 17:08:52 +02:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
daniel
906a1ba51f [bug 37746] string ids for content model and format.
The content model is stored as a varbinary(32), the format
as varbinary(64).

If the standard model resp. format is used, null is written
to the database instead of the actual id, saving space.

Change-Id: I32659b49a9ad3cb8ecae9019562cff7de42b65f9
2012-06-26 15:56:06 +02:00
umherirrender
a9a71011ff Change some NS_IMAGE to NS_FILE
Change-Id: Id530c88d24df1a47a2f6565911184008b67fe04d
2012-06-24 21:50:10 +02:00
daniel
43e9ff6571 remember to bump schema version and update xsd
Change-Id: I91666d78a8efae0186b0a181811dff1fa899070e
2012-06-21 19:10:13 +02:00
daniel
b801fa8b3b merged master
Change-Id: I6cf08c09c7d9b38ecce0b2bbed61431939edd7d4
2012-06-20 19:13:16 +02:00