Make ExternalStore wrap ExternalStoreFactory and create access class
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 27 Feb 2018 06:24:46 +0000 (22:24 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 28 Jun 2019 21:31:44 +0000 (14:31 -0700)
commitbaafb5adb400098f475c20fe10e3a181e87a4795
treea11e2fd8cb25cf431f90793819fa3d1bbceab3d1
parentca00e47f535129e067a078c96a90c6dfbae716b0
Make ExternalStore wrap ExternalStoreFactory and create access class

* Inject settings and global instances as dependencies to the
  ExternalStoreMedium instances. This includes the local wiki
  domain, so that wfWikiId() calls are not scattered around.
* Create ExternalStoreAccess service for read/write logic.
* Deprecate the ExternalStore wrapper methods.
* Add some exception cases for bogus store URLs are used instead
  of just giving PHP warnings and failing later.
* Make moveToExternal.php require the type/protocol to decide
  which ExternalStoreMedium to use instead of assuming "DB".
* Convert logging calls to use LoggerInterface.

Change-Id: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a
27 files changed:
autoload.php
includes/MediaWikiServices.php
includes/Revision/RevisionRenderer.php
includes/Revision/RevisionStore.php
includes/ServiceWiring.php
includes/Storage/BlobStoreFactory.php
includes/Storage/SqlBlobStore.php
includes/externalstore/ExternalStore.php
includes/externalstore/ExternalStoreAccess.php [new file with mode: 0644]
includes/externalstore/ExternalStoreDB.php
includes/externalstore/ExternalStoreException.php [new file with mode: 0644]
includes/externalstore/ExternalStoreFactory.php
includes/externalstore/ExternalStoreMedium.php
includes/externalstore/ExternalStoreMemory.php [new file with mode: 0644]
includes/externalstore/ExternalStoreMwstore.php
includes/historyblob/HistoryBlobStub.php
maintenance/storage/checkStorage.php
maintenance/storage/compressOld.php
maintenance/storage/moveToExternal.php
maintenance/storage/recompressTracked.php
tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php
tests/phpunit/includes/Revision/RevisionStoreTest.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/Storage/SqlBlobStoreTest.php
tests/phpunit/includes/externalstore/ExternalStoreAccessTest.php [new file with mode: 0644]
tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php
tests/phpunit/includes/externalstore/ExternalStoreTest.php