* FSFile should not be responsible for handling this much logic.
* Make more MediaHandler classes aware of the fact that an object
other than File might be passed in. Use the FSFile instead of a
useless empty stdClass object.
* Also added more fields to FSFile::placeholderProps to make it
more complete.
Change-Id: I9fe764b2a7261af507c6555e6a57273cf7d00d36
These no longer have any dependencies upon MediaWiki and can be split
out into a separate library.
Tests were updated for the new location and to no longer depend upon
MediaWikiTestCase.
Bug: T100922
Change-Id: I6ad507fa883d5934b807f9e31c507659d0730b52
Also add newFromConnection() methods for cleaner looking construction
since the IDatabase is fundamental and required.
Change-Id: Ife478d045cee92a30c91e9004833a557488bd512
* Refactored LBFactory a bit to make this possible.
* Move newChronologyProtector() up to LBFactory and
make a lazy-loading method instead.
* Move appendPreShutdownTimeAsQuery() up to LBFactory.
* Inject the web request values for LBFactory from Setup.php.
* Remove unused laggedSlaveUsed() method.
Change-Id: Ie8a38a6f4d6359680eb6a5be24a34e30b9816479
* Add DatabaseDomain class to handle passing domains around.
It also can be cast to and from strings, which are of the same
format as wfWikiId() except with hyphens escaped.
* Make IDatabase::getDomainID() use these IDs so they can be
passed into LoadBalancer::getConnection() and friends without
breaking on sites with a hyphen in the DB name.
* Add more LBFactory unit tests for domains.
Bug: T145840
Change-Id: Icfed62b251af8cef706a899197c3ccdb730ef4d1
The Database class was previously just a short-hand for "Database::",
and such calls should still work. The class now resides in /libs/rdbms.
The subclasses now extend DatabaseBase to avoid breaking type hints
that use that (hints use either IDatabase or DatabaseBase).
Also, use CASCADE with DROP TABLE for MySQL as with other DBs.
Keep SQLite excempt due to lack of support.
Added getDomainID() methods to avoid mentioning the word "wiki".
Change-Id: Ibd05d786cb26c21dcc9cb9601f6b2b52056af9ae
* The LoadMonitor interface is now ILoadMonitor.
* Nothing in this code was MySQL specific.
Now any DB type can benefit from a LoadMonitor.
Change-Id: I272a72cd55a70f99a866d518d44cb3bcaca91b9e
The former extends the later with MW-specific logic.
Also removed a wf* method call from ChronologyProtector.
Change-Id: I325f59b7467ab9c2137731d1ce69816f5a020f03
* Make the error message itself be dumb/raw.
* Make the exception exposer show the same GUI message.
* Remove overzelous wgLang check in MWExceptionRenderer.
Change-Id: Ifffff3b3cc785ea3080e4975efe33b3c2cf304d6
* This handles the work of showing exceptions so that
MWException does not have too.
* Simplify the DBError classes to regular Exception
classes. Lots of pointless prettification has been
removed, but DBConnectionError still gets the usual
special treatment of a fallback page and Google form.
* Remove hacky file cache fallback code that probably
did not work.
* Make MWExceptionHandler::report() wrap
MWExceptionExposer::output().
* Make MWException::runHooks() wrap
MWExceptionExposer::runHooks().
Change-Id: I5dfdc84e94ddac65417226cf7c84513ebb9f9faa
Linker::formatTemplates() was a static function that depended upon
global state like $wgLang (explicitly), $wgUser & $wgTitle (implicitly).
Moving it to a separate class allows us to clean it up a little bit and
use modern things like RequestContext and LinkRenderer.
Bug: T145177
Change-Id: Icdea8a2b299b4876feb3df3d66df3e4c104dd928
This was originally intended for use by ResourceLoader but it was
incomplete and not actually used by ResourceLoader at first.
Then 93d358cd added support for FileCache to ResourceLoader with
a separate ResourceFileCache class.
Also fixed typo in HTMLFileCache from 6559b8bf.
ObjectFileCache is not mentioned anywhere else in Wikimedia Git.
Change-Id: I69cca27ee7cd922da12f1793660432709c273be6