aboutsummaryrefslogtreecommitdiffstats
path: root/includes/installer/MysqlInstaller.php
Commit message (Collapse)AuthorAgeFilesLines
* Unify installer connection handlingTim Starling2024-09-261-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Postgres connection handling gave the caller a way to specify what sort of domain it needed, whereas the base class was implicitly relying on the sequence of installer steps to ensure that the current connection was correctly configured. The PG way of doing this is better for planned work in this area. Exposing PG-style connection management in the base class reduces the number of differences between PG and everything else. Instead of PG's method of having up to three connections open, I am just holding a single connection open, with state transitions properly implemented. Also: * Deprecate direct access to $this->db. * Factor out definitelyGetConnection(), a throwing variant of getConnection(). * Deprecate caling getConnection() with no parameter. * Remove setupSchemaVars(), since this was a sequence-dependent pattern. Instead configure schema vars on transition to the create-schema connection type. * Use SelectQueryBuilder in databaseExists(). * Remove the pg-commit install step. This commit dates back to bca55fa58f85fd5 (March 2007), where in the old installer a commit was done after all installation. It was moved here in 2010, but now we have a commit in createTables() serving the same purpose. If we need a transaction around interwiki insertion, we could do that in the base class, but that's not what the original code was trying to do. Change-Id: I073fb57c1b578361ac2a46ecd0cd1312c31747d4
* installer: Add missing documentation to class propertiesUmherirrender2024-09-071-0/+6
| | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I45c62ed8b6c2893b66f12dc60580c0267b475945
* rdbms: stop passing bogus $dbname values to DatabaseMySQL::open()Aaron Schulz2024-06-051-2/+2
| | | | | | The documentation does not mention false as an accepted value Change-Id: Iff79788884e8cc8686af08bfbde1704698b6c400
* Split web-specific code out of DatabaseInstallerTim Starling2024-03-131-160/+11
| | | | | | | | | | | | | | | | DatabaseInstaller had some LSP violations, such as calling undeclared methods of the supplied Installer object, assuming that it was a WebInstaller. It was also large. So, split the web form parts of DatabaseInstaller into separate classes. We have a class hierarchy for the connect forms, and a class hierarchy for the settings forms, with a base class DatabaseForm mostly as a place to put protected helper methods. Also, have DatabaseInstaller::getConnection() return a special subclass of Status, so that we can remove many Phan type overrides. Change-Id: Ie84025f8f70b895fa6882848b9a21ba1750d60e2
* installer: Namespace remaining classesReedy2024-01-131-1/+3
| | | | Change-Id: I11a8df30a2117ef29a4ade25f1082f25eb18490a
* installer: Namespace more installer classesReedy2024-01-131-0/+1
| | | | Change-Id: If58d96c311bef728446b517bb7a81316b23aad4d
* installer: Minor cleanupReedy2024-01-051-1/+1
| | | | | | * Minor comment tweaks Change-Id: I76b44fcd88f27f6182f2b245301298a182e870f5
* Redesign the installer with CodexAmir Sarabadani2023-12-131-3/+8
| | | | | | | | | It is not perfect, but it's a major improvement compared the existing one. We need to clean up a lot more once it has landed but it's a good start. Bug: T337435 Change-Id: I1f85110e754546c797d3325b8dd6878093790266
* Update references to renamed DatabaseMySQL classJames D. Forrester2023-11-011-1/+2
| | | | Change-Id: Ic8d411152f5c031db6f30fc243af999f0ba5509e
* Migrate another major batch to SelectQueryBuilderAmir Sarabadani2023-09-201-2/+5
| | | | | | | | I fixed some edge cases in the script that migrates to SQB and it managed to fix these now. Bug: T344971 Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
* Reorg: Move Status to MediaWiki\Status\Amir Sarabadani2023-08-251-0/+1
| | | | | | | | | | This class is used heavily basically everywhere, moving it to Utils wouldn't make much sense. Also with this change, we can move StatusValue to MediaWiki\Status as well. Bug: T321882 Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3 Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
* installer: Check MariaDB version in updater/installerUmherirrender2023-07-221-3/+16
| | | | | | | | | It always passed as the checked MySql version 5.7 is always higher as a MariaDB version. Distinct also the error message on type. Bug: T237898 Change-Id: Ie4853e90a7c8ea655feff2b7bd6402d587c08d50
* installer: Support SSL in the installermainframe982023-05-031-1/+8
| | | | | | | | Only MySQL/MariaDB and PostgreSQL will show this option, as SQLite connects to a file. Bug: T335828 Change-Id: If29429bcf32807620755dd0b8797d12a13668266
* rdbms: Remove Database::attributesFromType and hard-deprecate ::factoryAmir Sarabadani2023-02-231-2/+3
| | | | | | | | They have been soft-deprecated since 1.39 and the first one is not used anywhere, ::factory is used in some third party code but not in Wikimedia-deployed ones Change-Id: Icd0f743d9c76554dd02471485ee732e25b9fb932
* Reorg: Move HTML-related classes out of includes/ to Html/Amir Sarabadani2023-02-161-0/+1
| | | | | Bug: T321882 Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
* rdbms: remove IDatabase::selectDB()Aaron Schulz2023-01-171-4/+3
| | | | Change-Id: I0e5f9d82d487a1f74348942609625c58a7b1df32
* rdbms: Move Database::factory() to DatabaseFactory serviceKunal Mehta2022-08-311-1/+2
| | | | | | | | | | | | | We also bring along Database::attributesFromType(), which relied on the private ::getClass(). This requires us to inject DatabaseFactory through the LBFactory/LoadBalancer hierarchy. Database::factory() is now soft deprecated. All callers outside of includes/installer/ still need migration. Bug: T299691 Bug: T315270 Change-Id: I7d057a9438f1b097554679975e4e9b2fc99e7c2b
* installer: Require MySQL 5.7+ or MariaDB 10.3+, and distinguish in docsJames D. Forrester2022-05-151-1/+1
| | | | | | | | | | For now, runtime detection remains limited to the pseudo-version of MySQL as reported by MariaDB. Logic for this exists in rdbms/DatabaseMysqlBase which we could use in a later change. Bug: T273375 Bug: T299447 Change-Id: I102371a05cae4a0299e517703f2d56bbd799be6f
* Replace remaining usages of IDatabase::fetchObject()Alexander Vorwerk2022-01-191-1/+1
| | | | | Bug: T299471 Change-Id: I5acae5e72de2f85fd6e68e391297895c86ffb10e
* Fix typos in comments (M)Siddharth VP2022-01-091-1/+1
| | | | Change-Id: I5ab88a01ba3e5ea2aae853bb6f06492fbc84ceb5
* Use array_fill_keys() instead of array_flip() if that reflects the ↵Tim Starling2021-06-151-1/+1
| | | | | | | | | | | | | | | | | | developer's intention array_fill_keys() was introduced in PHP 5.2.0 and works like array_flip() except that it does only one thing (copying keys) instead of two things (copying keys and values). That makes it faster and more obvious. When array_flip() calls were paired, I left them as is, because that pattern is too cute. I couldn't kill something so cute. Sometimes it was hard to figure out whether the values in array_flip() result were used. That's the point of this change. If you use array_fill_keys(), the intention is obvious. Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
* Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUseJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
* installer: Rename Doxygen group from "Deployment" to "Installer"Timo Tijhof2019-11-251-2/+2
| | | | | | | 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
* Unsuppress another phan issue (part 7)Daimona Eaytoy2019-09-031-0/+1
| | | | | | | Bug: T231636 Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9 Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0 Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
* installer: Stop offering MyISAM option for new installs and fix bogus method ↵Aaron Schulz2019-07-201-41/+3
| | | | | | | | calls The methods were renamed in 2010 (r68908, c4100fb83b5b12bd). Change-Id: I076ec8d9c11f5bd33cb0ad19e5be8e239401b9c6
* Correct typo `notMinimumVerisonMessage'DannyS7122019-07-081-1/+1
| | | | | Bug: T224449 Change-Id: I4d76f900770f74ce668abf71ea5e7a9f167f5950
* Fix typo of Minimum in variable nameReedy2019-05-261-1/+1
| | | | Change-Id: I0d0ef26f59721039b2c24ab322fa3bf6ab16fea1
* Fix order of @var parameter in PHPFomafix2019-04-081-3/+3
| | | | | | | | | | | | Replace @var $foo type by @var type $foo Change-Id: Iec8b90ffea4028a1005daef422b7c4ec38c2715f
* Use PHP 7 '??' operator instead of if-then-elseFomafix2018-10-211-5/+1
| | | | Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
* Make MysqlInstaller check if DB exists in a cleaner wayAaron Schulz2018-08-241-2/+16
| | | | | | | Query the information schema rather than seeing if selectDB() returns false. This makes the installer able to handle an exception based failure mode. Change-Id: I7912b9d3b8501fbc92cb731547ae10fa2b0176db
* Merge "installer: Don't allow setting $wgDBmysql5"jenkins-bot2018-06-011-6/+1
|\
| * installer: Don't allow setting $wgDBmysql5Kunal Mehta2018-06-011-6/+1
| | | | | | | | | | | | | | | | | | | | It was possible to pass --dbmysql5 to the command line installer to enable this experimental option. This removes that ability, and removes setting of $wgDBmysql5 in the generated LocalSettings.php, so new installs will fallback to the default of false. Bug: T196185 Change-Id: Id5ff69f493d14cf7b16157f729fbe4f4b4e2e8c8
* | installer: Hide binary/utf-8 charset option from usersKunal Mehta2018-05-311-14/+0
|/ | | | | | | | | This is still used internally for the preUpgrade() checks that see if the user has an existing table using the utf8 charset, but hide it from users so they don't accidentally pick utf8. Bug: T196092 Change-Id: Iaace2e5bf9df7563e1d233496366c95b3f1faf16
* Remove support for PHP extension 'mysql' (not mysqli!)Seb352018-01-171-1/+1
| | | | | | | | | This PHP extension was deprecated in PHP 5.5 and removed in PHP 7.0. The newer MySQL driver 'mysqli' is the default driver since MediaWiki 1.22 and 'mysql' was deprecated in MediaWiki 1.30. Bug: T120333 Change-Id: Icff7a63ab47ae1483de87ba6486945974699362b
* Check minimum database server version when running update.phpKunal Mehta2017-10-021-7/+3
| | | | | | | | | 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
* Improve some parameter docsUmherirrender2017-09-101-0/+3
| | | | | | Add missing @return and @param to function docs and fixed some @param Change-Id: I810727961057cfdcc274428b239af5975c57468d
* Always put type information before variable name for @var tagsKunal Mehta2017-09-041-1/+1
| | | | | | | | | Like other tags, @var should have the type information before the variable name. <https://docs.phpdoc.org/references/phpdoc/tags/var.html> Change-Id: I9eca6957b1990fa8cc687103dc02ee38af5f9086
* Bump minimum required MySQL Version to 5.5.8Reedy2017-07-151-1/+1
| | | | | Bug: T161232 Change-Id: I5f7d08ad7e58ce89c9fd766f0ac45fa996bf6a44
* Merge "Revert "Revert "Fix the web updater"""jenkins-bot2017-05-241-2/+12
|\
| * Revert "Revert "Fix the web updater""Paladox2017-05-241-2/+12
| | | | | | | | | | | | This reverts commit a7b9cc4946a2f7fb081f64d9230bf944736a185b. Change-Id: I91d4b821df126703f83377dd8aff3a79b629f720
* | Merge "Revert "Fix the web updater""jenkins-bot2017-05-241-12/+2
|\|
| * Revert "Fix the web updater"Paladox2017-05-241-12/+2
| | | | | | | | | | | | | | | | May be causing beta to break, if that's true then we are going to revert 6519c42d248a78d2d42edee1beb21f926d227044 This reverts commit 5d56bcb925af653fed427e90a1cfb982de386720. Change-Id: I5e9df08dc1583266bb11b52d5d68bf393e4c0fff
* | Merge "installer: Replace bad calls to getText() on DBQueryError exceptions"jenkins-bot2017-05-241-2/+2
|\ \ | |/ |/|
| * installer: Replace bad calls to getText() on DBQueryError exceptionsmainframe982017-05-241-2/+2
| | | | | | | | | | | | | | | | The called method does not exist. Replaced with getMessage(), similar to PostgresInstaller.php. Bug: T165319 Change-Id: I900ec8c18307ce6f9e8c9f4cda79b1e33ed66dff
* | Fix the web updaterPaladox2017-05-191-2/+12
|/ | | | | | | It kept failing with Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ESCAPE '`'' at line 1 (localhost) Bug: T165805 Change-Id: I2671415fc34b1e6226104c88ca21fafc860bb7fb
* Move DB errors to Rdbms namespaceAaron Schulz2017-04-151-0/+2
| | | | Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
* Move Database and subclasses to Rdbms namespaceAaron Schulz2017-04-121-0/+2
| | | | Change-Id: I52bef87512f9ddd155d1f4cc0052f6b7a0db5b42
* MysqlInstaller: Restore missing functionBartosz Dziewoński2017-01-111-1/+14
| | | | | | | | | | Copied from rSVN45497. I'm not sure how to reproduce the circumstances in which this code gets called, so I didn't test it. But what we did before was clearly wrong. Bug: T154670 Change-Id: Id9b0282e7e65543999c9737950f5073ba2e81962
* Replace DatabaseBase => Database in more placesAaron Schulz2016-09-281-3/+3
| | | | Change-Id: If37a7909056bf2c31a8228cbc84f0fbbf5f1c517
* Replace DatabaseBase:: with Database:: and update type hintsAaron Schulz2016-09-271-5/+5
| | | | Change-Id: I3919b04eb2de4fa0bf8a02239fb5bbf17d347511