LocalFile: avoid hard failures on non-existing files.
authordaniel <dkinzler@wikimedia.org>
Fri, 30 Aug 2019 08:55:01 +0000 (10:55 +0200)
committerMobrovac <mobrovac@wikimedia.org>
Wed, 18 Sep 2019 09:18:44 +0000 (09:18 +0000)
commitbdc6b4e378c6872a20f6fb5842f1a49961af91b4
treee2434aea85814790d4c489c33f1d58e6952d3d97
parent7effb71c6dc1e25fc9d23910f76ea3df3f7f3fb3
LocalFile: avoid hard failures on non-existing files.

Some methods on LocalFile will fatal if called on a non-existing file.
ApiQueryImageInfo did not take that into account.

This patch changes LocalFile to avoid fatal errors, and ApiQueryImageInfo
to not try and report information on non-existing files.

NOTE: the modified code has NO test coverage! This should be fixed
before this patch is applied, or the patch needs to be thoroughly tested
manually.

Bug: T221812
Change-Id: I9b74545a393d1b7a25c8262d4fe37a6492bbc11e
RELEASE-NOTES-1.34
includes/api/ApiQueryImageInfo.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
tests/phpunit/includes/filerepo/file/LocalFileTest.php