resourceloader: Make various CSSMin performance optimizations and cleanups
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 19 Apr 2018 13:45:44 +0000 (15:45 +0200)
committerKrinkle <krinklemail@gmail.com>
Thu, 17 May 2018 18:34:41 +0000 (18:34 +0000)
commitff84fbe8a0d7ddfd535bb38d11ede04b9fad039e
tree3a90a11d23c43e6c33d09f3c1bdbb89b449a4dd1
parent13033333fb223d16392aad0e64549226654d7359
resourceloader: Make various CSSMin performance optimizations and cleanups

This is called relatively often. Even small improvements might have an
impact.

I'm intentionally replacing method_exists with class_exists because the
old check looked like it was done for backwards compatibility (MediaWiki
before 1.27 did not contained the method), while in reality this code is
meant to run without MediaWiki. This is much better reflected with a
straight "if this class doesn't exist, there is no MediaWiki".

I'm intentionally using the …::class feature. Yes, this works, even if the
class is not there.

Change-Id: I7f250a7cb000105bb751f68f25c6cc1c44c8f221
includes/libs/CSSMin.php
tests/phpunit/includes/libs/CSSMinTest.php