LoadExtensionSchemaUpdates hook handlers registered in the new
HookContainer style were not executed during install or update, due to
broken special case code which reads from ExtensionRegistry and
$wgHooks. So:
* In Installer, instead of hacking up $wgHooks, construct a special
HookContainer to be used for running LoadExtensionSchemaUpdates. Make
sure it contains new-style hooks.
* Pass the HookContainer from Installer to DatabaseInstaller via a
setter, and then have DatabaseUpdater fetch it using $this->parent.
* Refactor Installer::includeExtensions(), splitting the legacy
parts from the extension.json parts. A lot of weird things are done in
service of loading old-style registration files, which are almost
extinct at this point, so split out that code and only run it if there
is at least one legacy extension. The order in which updates are done
will change.
* The MW_EXTENSIONS_LOADED constant was previously used for global-level
communication between Installer and DatabaseUpdater. Leave it in for
now as a sanity check, but make it clear that it is redundant with the
new HookContainer injection.
* Similarly in DatabaseUpdater::loadExtensions(), construct a custom
HookContainer based on the existing LocalSettings.php.
* Use array_merge() instead of array_merge_recursive() when merging
legacy hooks.
Bug: T266681
Change-Id: I2c41ece04aed11a176559d4364cea2f3320b9574
Language objects contain references to service objects, so they need to
be be discarded when the global service container is reset by calling
MediaWikiServices::resetGlobalInstace(). The Installer class was doing
this correctly in the constructor, however, there where other calls to
resetGlobalInstace() during the installation process that did not
properly reset all language objects, which resulted in incorrect instances
of LocalisationCache being accessed.
This patch introduces the resetMediaWikiServices() method into the
Installer class which can be used to safely reset the service container
during installation.
Bug: T261081
Change-Id: I0ccab2b7fcac6942016430b1df5a1dbeb192f2f6
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: I5ffbb91882ecce2019ab644839eab5e8fb8a1c5f
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: If560596f5e1e0a3da91afc36e656e7c27f040968
This classes were found by surveying concrete classes derved from base
classes in core.
Bug: T247862
Change-Id: I231752aaad26e2ab3f097301e449b31e723590f0
Also improve the description a bit and explain at a high level
how this code is used, and which classes back those entry points.
Change-Id: Ia69531858e714d0b43a29a7d5b6dcc5c7edd8240
Adding optional $className parameter to provide additional
styling options.
Optional parameter $heading was introduced for MobileFrontend. Therefore
leaving inconsistent parameter order is necessary for the time being.
Bug: T232903
Change-Id: I5857b2c58a47a83156c32f086a73fe2bd48ab0c8
So other developers think that the class property name makes more
sense than the proposed name in the TODO section. In an attempt to
rename it in this patc: Ia9f0cd7d0117f67d2017e, it was rather adviced
to remove the todo and leave the class property name as-is.
Change-Id: I3336b5a6112f098e290f102caac6b04c0b50b076
New installation blocked when checking if the DB exists,
because when select DB, if it fails, it will throw an exception.
So I modify the checking logic to determine if there is an exception
thrown instead of detecting the return value.
Bug: T215566
Change-Id: I6817997434df7adc79fbc1b224b77c0daa8cc11d
This commit moves the call of the DatabaseUpdater::purgeCache
function into a try catch block which ensures
that the error will be displayed nicely.
Bug: T209341
Change-Id: I614444140e29948c41baa30dd557483b63f21a9a
With the introduction of CommentStore, selects from various table
require certain joins or column aliases for proper operation. The
upcoming actor table change, and the suggested title table change, will
add more such requirements.
Change-Id: Ic8213bff74b8350b15cd271d0ef252e63e7e79bd
If MediaWiki has increased the minimum database server version that is
required, check it when running update.php to ensure it is still
compatible. Previously this was only checked during the installer.
Bug: T162044
Change-Id: I47092c9557f4706a4dcb3a23150647e68af4317f
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168
Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||
Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files
Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
Also add newFromConnection() methods for cleaner looking construction
since the IDatabase is fundamental and required.
Change-Id: Ife478d045cee92a30c91e9004833a557488bd512
(This is part of I6ec374ac9 wich was a re-submit of Ie98bf5af5
which got reverted by Ide7ab563)
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:
* the installation process
* integration tests (which most of the existing phpunit tests are)
In contrast to I6ec374ac9, this change does not cause singeltons
of legacy services to be reset. It is assumed that legacy services
use global state to access services and configuration, so any
change in confuguration would affect them immediately.
NOTE: the original I6ec374ac9 would cause session information to
get lost if the user session was creatsed before initialization
was complete. This was apparently triggered by the MobileFrontend
extension under some circumstances. Check with Addshore and Catrope.
Change-Id: Ie06782ffb96e675c0aa55dc26fb8f22037e8517d
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:
* the installation process
* forking processes
* integration tests (which must of the existing phpunit tests are)
Depends-On: I5d638ad415fc3840186a0beaa09ac02ea688539b
Change-Id: Ie98bf5af59208f186dba59a9e971c72ea0b63e69
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.
Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.
Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.
Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
Since Id364306d883e0d494b948854e05f3f79ba7dd6d2 the text boxes on the
gui installer were not preloaded with the default values from
DefaultSettings.php.
Changed this by return all needed globals (defined by getGlobalNames)
from DatabaseInstaller::getGlobalDefaults(). This injects the as default
value in function getVar and than gets used, when no value is set.
Bug: T71281
Change-Id: I8217b25e903e40ec82be3d700381ff7aea3b481f
Was added in r69542 for interwiki-transclusion, but not populated.
Also make link for 'mw' consistent with 'mediawikiwiki' by using HTTPS.
Bug: 46992
Change-Id: Ieb6c4121ae4cd4e1aefbc372bbe82bdb0ce53b5d
The American Chemical Society suggested a new major MIME type for files
containing chemical data in 1998: http://dx.doi.org/10.1021/ci9803233
This suggestion got widely adopted and is now a de-facto-standard despite
not registered with IANA.
Applying this patch will allow us to continue with extension MolHandler
and PDBHandler.
http://fab.wmflabs.org/T352
- Fixes bug 66412 by creating a logic that will prevent running unneeded
updates.
Bug: 66412
Change-Id: Ic45dc1bce796a0406ed8a84e6274df1c4bda4967
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
While installing MediaWiki with a sqlite backend and missing the sqlite
extension, I have received the very helpful message:
DatabaseInstaller::setupSchemaVars: unexpected DB connection error
Which to me is as helpful as:
error
Since the database connection returns a Status object and that it got a
message attached, we might as well pass the error message when raising
the exception. We would end up with an error like:
DB connection error: could not find driver.
Check the data directory and database name below and try again.
That let me instantly facepalm and install the sqlite PHP extension
instead of wasting time figuring out what is happening.
Change-Id: Ife8e97242e1cfbdfbb572ad50cf8e4a7ad5b9dfc