Page MenuHomePhabricator

Deprecate $wgContentHandlerUseDB
Closed, ResolvedPublic

Description

As we're deprecating everything else, now is a good time to deprecate $wgContentHandlerUseDB so we can remove it at the same time as we remove the hooks and functions

Question is whether we need it for any sort of back compat for the updater to update oold MW installs?

Certainly removing it from conditionals in day to day code will be a future update

Details

Related Gerrit Patches:
mediawiki/core : masterDeprecate $wgContentHandlerUseDB

Event Timeline

Reedy created this task.Oct 14 2016, 11:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 14 2016, 11:41 AM

AIUI that was needed for extensions that used explicit $GLOBALS in their setup file, causing them to be registered. This setup is known to break the installer entirely (e.g. T69877), so I think we should just revert that patch.

Reedy added a comment.Jan 19 2017, 3:22 AM
Variable
    wgContentHandlerUseDB
Found usages  (70 usages found)
    Value read  (65 usages found)
        MediaWiki  (65 usages found)
            core/includes  (21 usages found)
                EditPage.php  (2 usages found)
                    EditPage  (2 usages found)
                        internalAttemptSave  (2 usages found)
                            1727global $wgContentHandlerUseDB;
                            1852if ( !$wgContentHandlerUseDB ) {
                MovePage.php  (2 usages found)
                    MovePage  (2 usages found)
                        isValidMove  (2 usages found)
                            89global $wgContentHandlerUseDB;
                            126if ( !$wgContentHandlerUseDB &&
                Revision.php  (13 usages found)
                    Revision  (13 usages found)
                        checkContentModel  (2 usages found)
                            1514global $wgContentHandlerUseDB;
                            1529if ( !$wgContentHandlerUseDB && $title ) {
                        insertOn  (2 usages found)
                            1398global $wgDefaultExternalStore, $wgContentHandlerUseDB;
                            1474if ( $wgContentHandlerUseDB ) {
                        newFromArchiveRow  (2 usages found)
                            185global $wgContentHandlerUseDB;
                            203if ( !$wgContentHandlerUseDB ) {
                        newNullRevision  (3 usages found)
                            1680global $wgContentHandlerUseDB, $wgContLang;
                            1685if ( $wgContentHandlerUseDB ) {
                            1722if ( $wgContentHandlerUseDB ) {
                        selectArchiveFields  (2 usages found)
                            475global $wgContentHandlerUseDB;
                            493if ( $wgContentHandlerUseDB ) {
                        selectFields  (2 usages found)
                            444global $wgContentHandlerUseDB;
                            461if ( $wgContentHandlerUseDB ) {
                Title.php  (4 usages found)
                    Title  (4 usages found)
                        getSelectFields  (2 usages found)
                            377global $wgContentHandlerUseDB, $wgPageLanguageUseDB;
                            384if ( $wgContentHandlerUseDB ) {
                        isSingleRevRedirect  (2 usages found)
                            3796global $wgContentHandlerUseDB;
                            3802if ( $wgContentHandlerUseDB ) {
            core/includes/cache  (2 usages found)
                LinkCache.php  (2 usages found)
                    LinkCache  (2 usages found)
                        getSelectFields  (2 usages found)
                            211global $wgContentHandlerUseDB, $wgPageLanguageUseDB;
                            214if ( $wgContentHandlerUseDB ) {
            core/includes/installer  (4 usages found)
                DatabaseUpdater.php  (4 usages found)
                    DatabaseUpdater  (4 usages found)
                        disableContentHandlerUseDB  (3 usages found)
                            1137global $wgContentHandlerUseDB;
                            1139if ( $wgContentHandlerUseDB ) {
                            1141$this->holdContentHandlerUseDB = $wgContentHandlerUseDB;
                        enableContentHandlerUseDB  (1 usage found)
                            1150global $wgContentHandlerUseDB;
            core/includes/page  (6 usages found)
                WikiPage.php  (6 usages found)
                    WikiPage  (6 usages found)
                        doDeleteArticleReal  (2 usages found)
                            2839global $wgUser, $wgContentHandlerUseDB;
                            2948if ( $wgContentHandlerUseDB ) {
                        selectFields  (2 usages found)
                            282global $wgContentHandlerUseDB, $wgPageLanguageUseDB;
                            298if ( $wgContentHandlerUseDB ) {
                        updateRevisionOn  (2 usages found)
                            1240global $wgContentHandlerUseDB;
                            1268if ( $wgContentHandlerUseDB ) {
            core/includes/specialpage  (2 usages found)
                SpecialPageFactory.php  (2 usages found)
                    SpecialPageFactory  (2 usages found)
                        getPageList  (2 usages found)
                            231global $wgPageLanguageUseDB, $wgContentHandlerUseDB;
                            257if ( $wgContentHandlerUseDB ) {
            core/maintenance  (2 usages found)
                dumpTextPass.php  (2 usages found)
                    TextPassDumper  (2 usages found)
                        getText  (2 usages found)
                            537global $wgContentHandlerUseDB;
                            554if ( $model === null && $wgContentHandlerUseDB ) {
            core/tests/phpunit/includes  (6 usages found)
                RevisionStorageTest.php  (6 usages found)
                    RevisionStorageTest  (6 usages found)
                        testGetContentFormat  (2 usages found)
                            338global $wgContentHandlerUseDB;
                            340if ( !$wgContentHandlerUseDB ) {
                        testGetContentModel  (2 usages found)
                            321global $wgContentHandlerUseDB;
                            323if ( !$wgContentHandlerUseDB ) {
                        testSelectFields  (2 usages found)
                            245global $wgContentHandlerUseDB;
                            257if ( $wgContentHandlerUseDB ) {
            core/tests/phpunit/includes/page  (6 usages found)
                WikiPageTest.php  (6 usages found)
                    WikiPageTest  (6 usages found)
                        testGetContentHandler  (2 usages found)
                            348global $wgContentHandlerUseDB;
                            350if ( !$wgContentHandlerUseDB ) {
                        testGetContentModel  (2 usages found)
                            328global $wgContentHandlerUseDB;
                            330if ( !$wgContentHandlerUseDB ) {
                        testIsCountable  (2 usages found)
                            566global $wgContentHandlerUseDB;
                            572if ( !$wgContentHandlerUseDB
            extensions/Flow/includes  (2 usages found)
                TalkpageManager.php  (2 usages found)
                    TalkpageManager  (2 usages found)
                        checkIfCreationIsPossible  (2 usages found)
                            147global $wgContentHandlerUseDB;
                            151if ( !$wgContentHandlerUseDB ) {
            extensions/OAI  (2 usages found)
                OAIRepo_body.php  (2 usages found)
                    OAIRepo  (2 usages found)
                        getFields  (2 usages found)
                            729global $wgContentHandlerUseDB;
                            739if ( $wgContentHandlerUseDB ) {
            extensions/ProofreadPage  (2 usages found)
                ProofreadPage.body.php  (2 usages found)
                    ProofreadPage  (2 usages found)
                        onLoadExtensionSchemaUpdates  (2 usages found)
                            695global $wgContentHandlerUseDB;
                            702if ( isset( $wgContentHandlerUseDB ) && $wgContentHandlerUseDB ) {
            extensions/Wikibase/repo/config  (1 usage found)
                Wikibase.example.php  (1 usage found)
                      (1 usage found)
                        22global $wgContentHandlerUseDB, $wgExtraNamespaces, $wgWBRepoSettings;
            extensions/Wikibase/repo/includes/Store/Sql  (2 usages found)
                EntityPerPageBuilder.php  (2 usages found)
                    EntityPerPageBuilder  (2 usages found)
                        getQueryConds  (2 usages found)
                            156global $wgContentHandlerUseDB;
                            163if ( $wgContentHandlerUseDB ) {
            extensions/Wikibase/repo/tests/phpunit/includes/Api  (2 usages found)
                EditPageTest.php  (2 usages found)
                    EditPageTest  (2 usages found)
                        testEditTextInItemNamespace  (2 usages found)
                            62global $wgContentHandlerUseDB;
                            85if ( !$wgContentHandlerUseDB ) {
            extensions/Wikidata/extensions/Wikibase/repo/config  (1 usage found)
                Wikibase.example.php  (1 usage found)
                      (1 usage found)
                        22global $wgContentHandlerUseDB, $wgExtraNamespaces, $wgWBRepoSettings;
            extensions/Wikidata/extensions/Wikibase/repo/includes/Store/Sql  (2 usages found)
                EntityPerPageBuilder.php  (2 usages found)
                    EntityPerPageBuilder  (2 usages found)
                        getQueryConds  (2 usages found)
                            156global $wgContentHandlerUseDB;
                            163if ( $wgContentHandlerUseDB ) {
            extensions/Wikidata/extensions/Wikibase/repo/tests/phpunit/includes/Api  (2 usages found)
                EditPageTest.php  (2 usages found)
                    EditPageTest  (2 usages found)
                        testEditTextInItemNamespace  (2 usages found)
                            62global $wgContentHandlerUseDB;
                            85if ( !$wgContentHandlerUseDB ) {
    Value write  (5 usages found)
        MediaWiki  (5 usages found)
            core/includes  (1 usage found)
                DefaultSettings.php  (1 usage found)
                    8236$wgContentHandlerUseDB = true;
            core/includes/installer  (2 usages found)
                DatabaseUpdater.php  (2 usages found)
                    DatabaseUpdater  (2 usages found)
                        disableContentHandlerUseDB  (1 usage found)
                            1142$wgContentHandlerUseDB = false;
                        enableContentHandlerUseDB  (1 usage found)
                            1154$wgContentHandlerUseDB = $this->holdContentHandlerUseDB;
            extensions/Wikibase/repo/config  (1 usage found)
                Wikibase.example.php  (1 usage found)
                      (1 usage found)
                        25$wgContentHandlerUseDB = true;
            extensions/Wikidata/extensions/Wikibase/repo/config  (1 usage found)
                Wikibase.example.php  (1 usage found)
                      (1 usage found)
                        25$wgContentHandlerUseDB = true;
Reedy added a subscriber: daniel.Jan 19 2017, 3:22 AM

We should keep $wgContentHandlerUseDB around and just set it to true in Setup.php and mark it as deprecated.

As Sam put it, this is neither a function nor a hook, so I'm removing it from blocking the parent.

Anomie added a subscriber: Anomie.Sep 10 2019, 6:16 PM

I note that MCR work has effectively deprecated this already: RevisionStore will throw an exception if this is set false and the MCR migration stage is not SCHEMA_COMPAT_OLD. But no one has gotten around to formally marking it as deprecated.

Change 535666 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Deprecate $wgContentHandlerUseDB

https://gerrit.wikimedia.org/r/535666

Change 535666 merged by jenkins-bot:
[mediawiki/core@master] Deprecate $wgContentHandlerUseDB

https://gerrit.wikimedia.org/r/535666

Anomie closed this task as Resolved.Sep 10 2019, 8:11 PM
Anomie claimed this task.