Commit graph

213 commits

Author SHA1 Message Date
Kunal Mehta
ce49874d9f Add checkComposerLockUpToDate.php script
Checks whether your composer.lock file is up to date
with the current composer.json file.

Bug: T77388
Change-Id: I528d63172c238cf1ea9bc02e8eb39b93225865de
2014-12-29 23:20:30 +00:00
Reedy
4d9143c7f5 Add lots of @throws
Change-Id: I09d0c13070f966fcf23d2638d8fc1328279a5995
2014-12-24 13:49:20 +00:00
Alex Monk
901b28fb51 Fix error in docs of VirtualRESTServiceClient and MultiHttpClient
err -> error

Change-Id: I758c026599367b282150a513b09d6f6c837a3a80
2014-12-19 21:51:45 +00:00
Alex Monk
a6dadae49f Fix VirtualRESTServiceClient::run
runMulti returns an array of response arrays, not request arrays.

Change-Id: I1d57ff24c43c033d533630c23fe3e1e85b448013
2014-12-19 20:08:31 +00:00
Aaron Schulz
acbdfe48ff Fixed comment typo and other docs tweaks
Change-Id: I0368561611071f0e4722661e7f7c146618f3364a
2014-12-18 17:35:10 -08:00
jenkins-bot
d34a6ca677 Merge "Fix some stuttering in comments and documentation" 2014-12-17 22:28:27 +00:00
Aaron Schulz
626aede99b Made a new SectionProfileCallback class that extends ScopedCallback
* This is now used by SectionProfiler and avoids the high overhead of call_user_func_array().

Change-Id: I7ff2c9a35c7cd8ee462f2368b655e766ad33dd63
2014-12-17 13:16:06 -08:00
Ricordisamoa
12dec5d85d Fix some stuttering in comments and documentation
Change-Id: I9c0088b9aab37335203cad45a1d6fa8ac3f43321
2014-12-17 19:44:10 +00:00
Bryan Davis
dad7abd9ce Create a generic UDP transport class
Code moved from MWLoggerLegacyLogger::emit(), which was formerly
in wfErrorLog().

Bug: T74572
Bug: T78599
Change-Id: I9e0e63d41bed6ccb468f3a9f1d52f156acc355a8
2014-12-15 15:06:43 -07:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
Ricordisamoa
f86a5590aa Always use 'bool' instead of 'boolean' after '@param' and '@return'
The former is by far the most common.

Skipped:
* resources/lib/jquery.ui/jquery.ui.datepicker.js
* resources/src/mediawiki.special/mediawiki.special.upload.js

Change-Id: I73c93797e745128ba703e4865080c36784caa474
2014-12-10 11:57:31 +00:00
Aaron Schulz
2698d9803d Made SectionProfiler cache the ScopedCallback closure to lower overhead
Change-Id: Ia6f2ef4bb82dad13d49e74c730530295d5719009
2014-12-09 23:40:35 +00:00
Bryan Davis
e222ba3628 xhprof: Guard against division by 0 when computing percentages
Change-Id: Icce3b5be1136c541dc87c44b01a42709f19ca885
2014-12-03 19:10:57 -07:00
Timo Tijhof
ff6513f28b Remove '@section LICENSE'
This was used in 2 special classes, the logger classes and spread
to a few other random classes.

Afaik this has no meaning. Is for something we don't use, and
goes against the meaning of '@section' in Doxygen, which we do
use.

In Doxygen output, all LICENSE references became links to
ProfilerXhprof (the one Doxygen encoutered first).

Bug: T72328
Change-Id: Icc7c443245c70bc0f549bee7d105eef5691c864d
2014-11-26 02:20:55 +00:00
Kunal Mehta
1eb52568d9 Load lessphp via composer
Adds leafo/lessphp 0.5.0 as a dependency, and removes the current
copy of lessphp.

Depends on 7b2af65827 in mediawiki/vendor.

Bug: T1337
Change-Id: Ib5ab4c872d5236258df97d49f4ba72a20758a2e9
2014-11-24 19:14:42 +00:00
paladox
9d97fb855c Update lessphp to 011afcca8e
Source:

* 011afcca8e/lessc.inc.php

Changes:

* 2cc77e3c7b...011afcca8e

Change-Id: Ic21b97e52ec99b8eef094a902ee346cf40a9f174
2014-11-24 10:56:00 +00:00
Kunal Mehta
987d2e4c77 Use cdb library and provide a back-compat layer
The new cdb library is pulled in via composer. Since the
library uses namespaces, a backwards-compatability layer
is provided for the old class names:
* CdbReader
* CdbWriter
* CdbException

The PHP/DBA-specific classes should never have been used directly.

Depends on I98302bdf1 in mediawiki/vendor

Change-Id: I39549ac8540b262cf91f7d1830d36327afb3033d
2014-11-19 18:39:27 +00:00
Bartosz Dziewoński
6e82fe6417 CSSMin: Rewrite encodeImageAsDataURI()
* Make it actually check against the URI length, not file size.
  Previous code could produce URIs that edged just over the limit.
* Replace $sizeLimit parameter with $ie8Compat, because that's the
  only use case and the file size limit approach was flawed per above,
  anyway.
* Remove CSSMin::EMBED_SIZE_LIMIT constant, which is not used anymore.
  CSSMin::DATA_URI_SIZE_LIMIT still exists.
* Change code flow to avoid repetition.
* Split off new method, encodeStringAsDataURI(), that does actual
  encoding rather than file handling.

Change-Id: I3704404ce831d7e0f6e3a65f23c76f313ad13238
2014-11-16 18:06:35 +00:00
jenkins-bot
0e2a9baff3 Merge "Enable profiling via xhprof" 2014-11-12 22:00:30 +00:00
Aaron Schulz
93d2167ca6 Moved MapCacheLRU to libs/
Change-Id: Icb820787afe7298dd3124f5168d3efff19e53ab6
2014-11-10 22:51:29 +00:00
Kunal Mehta
fb54343d6f cdb: One class per file
Change-Id: I18c6f58d8b3747c4da9d74884a3c9a3571f403f3
2014-11-10 19:05:34 +00:00
Kunal Mehta
102fc2ac7b Move Cdb classes into includes/libs/cdb/
Change-Id: I2c4fa605acf5e0cf1fdd4821fe6bcdd690b02759
2014-11-10 10:42:30 -08:00
Bryan Davis
46c47e11bc Enable profiling via xhprof
Add a helper class to assist in collecting profiling information using
XHProf <https://github.com/phacility/xhprof> and a Profiler
implementation to hook it into the existing MediaWiki profiling system.

The Profiler includes support for generating tabular reports similar to
the traditional output of ProfilerSimpleText and ProfilerSimpleTrace or
sending data to a udpprofile daemon as supported by ProfilerSimpleUDP.
It also produces data compatible with the debugging toolbar.

Bug: T759
Change-Id: I16a75cb7636cb5dcef3830d738b2dcd2047d0aaa
2014-11-08 11:47:25 -07:00
Kunal Mehta
d5563db924 Deprecate MWFunction::newObj() in favor of ObjectFactory
Change-Id: Iaa803311409cf7b649f64f69bafe2935a418d31c
2014-11-06 13:41:18 -07:00
Chad Horohoe
519fd863aa Move Cookie(Jar) to libs/
This doesn't rely on any other parts of MediaWiki since we can
replace MWException with InvalidArgumentException here.

Change-Id: Id4512b184d24efc6674d486a5d452aa44dc871c6
2014-11-06 18:12:51 +00:00
Kunal Mehta
e1bd68f032 Move ArrayUtils into libs/ as there is nothing tying it to MediaWiki
Change-Id: I6910c85279858895f5462324134bade580a0cae7
2014-11-06 16:17:23 +00:00
Kunal Mehta
5357441fd3 Use CSSJanus via composer
Requires I7de49f443 in mediawiki/vendor

Change-Id: I94837938f0e0f3daa4d1f53c390457f843000605
2014-11-05 21:03:26 +00:00
jenkins-bot
752df151c6 Merge "Make $wgMWLoggerDefaultSpi more expressive" 2014-10-27 17:08:04 +00:00
Bryan Davis
51b37035b3 Make $wgMWLoggerDefaultSpi more expressive
Allow $wgMWLoggerDefaultSpi to specify a more expressive object creation
by introducing a new ObjectFactory class which can process an array of
instructions to call either an object constructor or a factory method
with an array of arguments. This allows removal of the
$wgMWLoggerMonologSpiConfig global variable in favor of configuration
using $wgMWLoggerDefaultSpi.

New classes introduced:
; ObjectFactory
: Construct objects from configuration instructions.

Change-Id: If56cce5dcb1ad5712e238d6e2dab809a351f79be
2014-10-25 16:00:06 -06:00
Bryan Davis
63233fa55c jsminplus: Fix string concatenation in error message
PHP concatenates strings with the `.` operator, not with `+`.

Change-Id: I628a55d714129a1345c37bfd31d8985bce177701
2014-10-22 11:44:49 +00:00
jenkins-bot
175bc36798 Merge "Improved timestamp precision in ProcessCacheLRU" 2014-10-02 21:12:34 +00:00
Bartosz Dziewoński
bf3b97791b CSSMin: Don't generate double rules for IE < 8 when embedding SVG files
Bug: 71003
Change-Id: Ic232e8d62b164940003afdfe7cce9f964d7e9cbc
2014-09-30 21:19:58 +00:00
Bartosz Dziewoński
fa223d65d6 CSSMin: Do not base64-encode non-binary files when embedding
Do not base64-encode non-binary files (containing only whitespace and
printable ASCII characters, which matches sane SVG files).

For SVG files the percent-encoded URIs are actually slightly longer
than the base64-encoded ones (~10%), but compress a lot better
resulting on 15-20% less data to transfer after gzip compression.

(The effect is best seen on the 'oojs-ui' module, which consists
mostly of SVG icons – especially after commenting out everything other
than 'oojs-ui.svg.css'.)

I tried this for binary files too, just in case; but as expected, they
suffer from a noticeable size increase even with compression (~15%).

Bug: 67341
Change-Id: Iddaf863b6be98570a2bb8e606f13946a96345f65
2014-09-30 23:13:42 +02:00
Timo Tijhof
282847e6d3 Use CSSJanus from upstream (v1.1.0)
Remove the local copy and include upstream instead.

Remove local unit tests as it's now a proper upstream lib that
is tested by uptream.

Release:

  https://github.com/cssjanus/php-cssjanus/releases/tag/v1.1.0

Changes:

  Features
  * Support "/*!" syntax for @noflip.
  * Flip border-style.

  Bug fixes
  * Improve flipping of background-position.
  * Restrict four_notation_quantity to margin, padding and border-width.
  * Flip two values in border-radius rule (in addition to four values).

Change-Id: Ieb6e179d6163f99a9c98fd99c2277d25135871fe
2014-09-25 18:00:27 -07:00
Aaron Schulz
149e397fbe Improved timestamp precision in ProcessCacheLRU
Change-Id: I42f27df4ec9f944bd308e13eb832d84f1d9492a9
2014-09-25 12:04:09 -07:00
csteipp
6aa3befeb0 SECURITY: Enhance CSS filtering in SVG files
* Filter <style> elements
* Normalize style elements and attributes before filtering
* Add checks for attributes that contain css
* Add unit tests for html5sec and reported bugs

Bug:69008
Change-Id: I732eece710f1bfaaeea1e5de541fcd4cfb375de7
2014-09-24 21:06:54 +02:00
Bartosz Dziewoński
4c01f8b2bc Make "/*@noflip*/ /*@embed*/" annotation work without CSSJanus hacks
This reverts most of commit 2d842f1425,
leaving only the test added in it, and reimplements the same
functionality better.

Instead of stripping /*@noflip*/ annotations in CSSJanus, which is
incompatible with other implementations that preserve it, extend
CSSMin to allow other CSS comments to be present before the
rule-global @embed annotation. (This required making the regex logic
in it even worse than it was, but it's actually slightly less terrible
than I expected it would be. Good thing we have tests!)

Bug: 69698
Change-Id: I58603ef64f7d7cdc6461b34721a4d6b15f15ad79
2014-09-23 22:47:54 +00:00
Timo Tijhof
bb5709241e CSSJanus: Add Apache license header
Follows-up f9e8d61 which removed the Python library and its copy
of the Apache license file.

Change-Id: Ic3ed4a2fb935e713916cb8eb6ba1673839f40532
2014-09-20 17:21:53 -07:00
Kevin Israel
eac059c722 Remove dead mime_content_type() code paths
Since PHP 5.3, mime_content_type() is implemented as part of PHP's
fileinfo extension and thus is deprecated in favor of the newer
alternatives provided by that extension (already in use).

Also updated a comment in DefaultSettings.php that mentioned the
function. Did not modify lessc.inc.php, a third-party library
maintained separately from MediaWiki.

Change-Id: Ic4a0873989ddb634ec9a05c3340941a9ba3f5ec5
2014-09-03 16:35:35 +00:00
Bartosz Dziewoński
2d842f1425 Make "/*@noflip*/ /*@embed*/" annotation work
To do it, just remove /*@noflip*/ annotations in CSSJanus after
we're done processing. They are not needed anymore and some obscure
interactions with CSSMin logic for preserving comments caused
`/*@noflip*/ /*@embed*/ background-image: url(…)` not to work
correctly (it would not be embedded).

This also requires us to always do CSSJanus processing, even when we
don't need flipping, to consistently handle the annotations.
I'm not entirely sure if this is worth it, but I still greatly prefer
doing it to documenting this stupid limitation. :)

Bug: 69698
Change-Id: I311b12b08b2dff9d45efb584db08cf4a11318f59
2014-08-18 17:40:51 +02:00
Aaron Schulz
0702671f2e Fixed doc comment
Change-Id: I906f3f34ac27207dd6b87b07fa6e791bc7b66691
2014-08-14 15:35:30 -07:00
rillke
c31fbf073e Unify the spelling of MIME in documentation
Writing MIME as written in Wikipedia and some documentation clean up.

Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
2014-08-07 23:38:45 +02:00
Shahyar
923ad97b3a Correct shadow flipping in CSSJanus
Was incorrectly assuming values between -1 and 1 were 0
Fixes an issue with mw-ui-input class in RTL mode which
makes use of box shadow.

Change-Id: I13e52467721bc2534e0a7c5245e3380ac43736ef
2014-07-30 23:14:32 +00:00
Timo Tijhof
3b229c06be CSSMin: Add link to css-syntax spec for url tokens on w3.org
Change-Id: I9bfd7016ba4ec106e1b92602fd6d8188b8b183f3
2014-07-12 02:00:55 +02:00
umherirrender
b18d8d7e01 Remove OutputPage::getStatusMessage() (deprecated since 1.18)
Also removed a comment where the method was mentioned.

Change-Id: I802f0f41e107a1d677fb899f6e09ea31df3c4e6f
2014-07-09 01:41:18 +02:00
Aaron Schulz
3993b6a4de Fixed broken exception code
Change-Id: Id399cb22f183d75acc006e698feb161bd12096bd
2014-07-03 16:37:25 -07:00
Stephan Gambke
3b1b2b0c33 Fix CSSMin url() remapping when comments in CSS contain curly braces
Remapping of url()s was thrown off if the CSS contained comments
with curly braces. To fix, replace all block comments (except @embed
directives) with placeholders before url() processing and swap them
back in afterwards. Patch also includes tests.

Bug: 60077
Change-Id: If18a93c17ea9bcd529f6a664aa2dcc51d4a37f38
2014-06-30 09:14:10 +00:00
Trevor Parscal
3e2fd810d2 Revert "Fix "CSSMin url() value remapping not working in certain obscure cases""
This reverts commit fa1053a16a.

Breaks CSS output, making the skin and extensions look unstyled.

Change-Id: I297150f775dd5559f91f2c9c25c64b134459c6b6
2014-06-10 22:04:40 +00:00
Stephan Gambke
fa1053a16a Fix "CSSMin url() value remapping not working in certain obscure cases"
This patch extends the regex used to find URLs by css block quote subpatterns.

Bug: 60077
Change-Id: Ife00d01b78c6369f20ffc49d20aa58e354a61ee7
2014-06-09 23:50:28 +02:00
Brandon Black
e323bc3393 Speed up CIDR matching from $wgSquidServersNoPurge
This adds a new generic library class IPSet, which precomputes
a reasonably-efficient data structure from the input list of
addresses and CIDR net/mask specs for fast runtime matching,
and then uses it to check trusted XFF-setters.

See also: 32b4f19f173fc5cff1029eedee63a39a2d72dd3a
Bug: 57021
Change-Id: Ia3b12fb90c3e7e492374a128943b014481cc2730
2014-05-15 17:23:12 +00:00