Remove wfDl() and cleanup everything it touched
authorChad Horohoe <chadh@wikimedia.org>
Wed, 9 Oct 2013 16:46:57 +0000 (09:46 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Wed, 9 Oct 2013 17:51:35 +0000 (10:51 -0700)
commitd0c8ba037cf6901d490984106677ec4785c51796
tree9ac1e11ce15ba2e16222d0d78684213104dd7b20
parent51833b036fad49e68d12e1f89b56fd098439f870
Remove wfDl() and cleanup everything it touched

wfDl() is a wrapper around dl(), which is an evil function and
basically only works from the command line of Zend. Luckily
no extension has ever used this thing, so let's just remove it
outright.

For comparison, here's a list of places it does not work:
- hhvm
- php as apache module
- php compiled with zts support
- safe_mode
- Basically any shared host that cares about security

Most callers are using it to check for extension support and are
actually failing gracefully when wfDl() returns false. In these
places we're just going to use extension_loaded().

While we're at it, clean up some of the test skip logic in the
media tests so we can bail as early as possible if we know we
can't complete the test.

This also immediately removes $wgLoadFileinfoExtension. It's been
enabled by default since 5.3 and falls back gracefully when the
support isn't available.

Change-Id: Ieb430dfc74483731dde51d6e20fa700d641ba1f4
17 files changed:
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/MimeMagic.php
includes/db/DatabaseMysql.php
includes/diff/DifferenceEngine.php
includes/installer/DatabaseInstaller.php
maintenance/backup.inc
maintenance/sqlite.inc
tests/phpunit/includes/CollationTest.php
tests/phpunit/includes/media/BitmapMetadataHandlerTest.php
tests/phpunit/includes/media/ExifBitmapTest.php
tests/phpunit/includes/media/ExifRotationTest.php
tests/phpunit/includes/media/ExifTest.php
tests/phpunit/includes/media/FormatMetadataTest.php
tests/phpunit/includes/media/JpegTest.php
tests/phpunit/includes/media/TiffTest.php
tests/phpunit/includes/media/XMPTest.php