(bug 31044) Make ResourceLoader behave in read-only mode
authorCatrope <roan.kattouw@gmail.com>
Tue, 15 Jan 2013 23:32:10 +0000 (15:32 -0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 16 Jan 2013 03:10:26 +0000 (03:10 +0000)
commite2e8461fd23d81aa3c89a56245053c6d3f06da84
treef2fb568eee213fc01820e54c43ac2e4c9e9ce35a
parentab8de17e0f7bc40eecee7d9e32cd0ccd9e783610
(bug 31044) Make ResourceLoader behave in read-only mode

When the database is in read-only mode or writes fail for some other
reason, ResourceLoader should make every attempt to still serve JS and
CSS correctly.

* Surround a bunch of DB write code in MessageBlobStore.php in try-catch
  blocks.
* Surround the DB write in ResourceLoaderFileModule.php in a try-catch
  block rather than checking wfReadOnly(), because the DB may fail for
  other reasons.
* In ResourceLoader::respond() and helpers, set a short cache timeout on
  responses that include commented-out error messages.

Change-Id: Idc83a0fe042806263f9337c40ade8c38c56aa3cd
includes/MessageBlobStore.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderFileModule.php