Page MenuHomePhabricator

Find a new home for SpecialVersion static functions that interact with extension/skin files
Open, Needs TriagePublic

Description

SpecialVersion has functions like getExtLicenseFileName and getExtAuthorsFileName that are used by at least the API outside of the special page

There's gotta be a better home for them

Not all of these are necessarily in scope... But usages of it

Targets
    Occurrences of 'SpecialVersion::' in directory /Users/reedy/PhpstormProjects/mediawiki/core/includes
Found Occurrences  (14 usages found)
    Unclassified occurrence  (12 usages found)
        mediawiki  (12 usages found)
            core/includes/api  (8 usages found)
                ApiHelp.php  (2 usages found)
                    140 str_replace( ' ', '_', SpecialVersion::getVersion( 'nodb' ) ) );
                    388 } elseif ( SpecialVersion::getExtLicenseFileName( dirname( $sourceInfo['path'] ) ) ) {
                ApiParamInfo.php  (1 usage found)
                    268 } elseif ( SpecialVersion::getExtLicenseFileName( dirname( $sourceInfo['path'] ) ) ) {
                ApiQuerySiteinfo.php  (5 usages found)
                    188 $git = SpecialVersion::getGitHeadSha1( $IP );
                    192 SpecialVersion::getGitCurrentBranch( $GLOBALS['IP'] );
                    647 if ( SpecialVersion::getExtLicenseFileName( $extensionPath ) ) {
                    655 if ( SpecialVersion::getExtAuthorsFileName( $extensionPath ) ) {
                    872 'subscribers' => array_map( [ SpecialVersion::class, 'arrayToString' ], $subscribers ),
            core/includes/installer  (2 usages found)
                WebInstallerOptions.php  (1 usage found)
                    158 $types = SpecialVersion::getExtensionTypes();
                WebInstallerWelcome.php  (1 usage found)
                    38 SpecialVersion::getCopyrightAndAuthorList(),
            core/includes/parser  (1 usage found)
                CoreMagicWords.php  (1 usage found)
                    288 return SpecialVersion::getVersion();
            core/includes/specialpage  (1 usage found)
                SpecialPageFactory.php  (1 usage found)
                    161 'Version' => \SpecialVersion::class,
    Usage in comments  (2 usages found)
        mediawiki  (2 usages found)
            core/includes  (1 usage found)
                DefaultSettings.php  (1 usage found)
                    7753 *    ExtensionTypes hook as used in SpecialVersion::getExtensionTypes().
            core/includes/specials/Hook  (1 usage found)
                SoftwareInfoHook.php  (1 usage found)
                    16 *   SpecialVersion::softwareInformation().
Class
    SpecialVersion   
Found usages  (20 usages found)
    Class static member access  (19 usages found)
        mediawiki  (19 usages found)
            core/includes/api  (8 usages found)
                ApiHelp.php  (2 usages found)
                    ApiHelp  (2 usages found)
                        getHelp  (1 usage found)
                            140 str_replace( ' ', '_', SpecialVersion::getVersion( 'nodb' ) ) );
                        getHelpInternal  (1 usage found)
                            388 } elseif ( SpecialVersion::getExtLicenseFileName( dirname( $sourceInfo['path'] ) ) ) {
                ApiParamInfo.php  (1 usage found)
                    ApiParamInfo  (1 usage found)
                        getModuleInfo  (1 usage found)
                            268 } elseif ( SpecialVersion::getExtLicenseFileName( dirname( $sourceInfo['path'] ) ) ) {
                ApiQuerySiteinfo.php  (5 usages found)
                    ApiQuerySiteinfo  (5 usages found)
                        appendExtensions  (2 usages found)
                            647 if ( SpecialVersion::getExtLicenseFileName( $extensionPath ) ) {
                            655 if ( SpecialVersion::getExtAuthorsFileName( $extensionPath ) ) {
                        appendGeneralInfo  (2 usages found)
                            188 $git = SpecialVersion::getGitHeadSha1( $IP );
                            192 SpecialVersion::getGitCurrentBranch( $GLOBALS['IP'] );
                        appendSubscribedHooks  (1 usage found)
                            872 'subscribers' => array_map( [ SpecialVersion::class, 'arrayToString' ], $subscribers ),
            core/includes/installer  (2 usages found)
                WebInstallerOptions.php  (1 usage found)
                    WebInstallerOptions  (1 usage found)
                        execute  (1 usage found)
                            158 $types = SpecialVersion::getExtensionTypes();
                WebInstallerWelcome.php  (1 usage found)
                    WebInstallerWelcome  (1 usage found)
                        execute  (1 usage found)
                            38 SpecialVersion::getCopyrightAndAuthorList(),
            core/includes/parser  (1 usage found)
                CoreMagicWords.php  (1 usage found)
                    CoreMagicWords  (1 usage found)
                        expand  (1 usage found)
                            288 return SpecialVersion::getVersion();
            core/includes/specialpage  (1 usage found)
                SpecialPageFactory.php  (1 usage found)
                    SpecialPageFactory  (1 usage found)
                        161 'Version' => \SpecialVersion::class,
            core/maintenance/language  (1 usage found)
                StatOutputs.php  (1 usage found)
                    WikiStatsOutput  (1 usage found)
                        heading  (1 usage found)
                            59 $version = SpecialVersion::getVersion( 'nodb' );
            core/tests/parser  (1 usage found)
                parserTests.php  (1 usage found)
                    ParserTestsMaintenance  (1 usage found)
                        execute  (1 usage found)
                            99 $version = SpecialVersion::getVersion( 'nodb' );
            extensions/OpenID/includes/specials  (1 usage found)
                SpecialOpenIDDashboard.php  (1 usage found)
                    SpecialOpenIDDashboard  (1 usage found)
                        execute  (1 usage found)
                            101 $out .= $this->show( 'MediaWiki ' . wfMessage( 'version-software-version' )->text(), SpecialVersion::getVersion() );
            extensions/PageForms/includes  (1 usage found)
                PF_AutoeditAPI.php  (1 usage found)
                    PFAutoeditAPI  (1 usage found)
                        getVersion  (1 usage found)
                            1280 $gitSha1 = SpecialVersion::getGitHeadSha1( $wgPageFormsIP );
            extensions/PhpTagsWiki/includes  (1 usage found)
                WikiW.php  (1 usage found)
                    WikiW  (1 usage found)
                        c_CURRENT_VERSION  (1 usage found)
                            27 $value = \SpecialVersion::getVersion();
            extensions/Scribunto/includes/engines/LuaCommon  (1 usage found)
                SiteLibrary.php  (1 usage found)
                    Scribunto_LuaSiteLibrary  (1 usage found)
                        register  (1 usage found)
                            28 'currentVersion' => SpecialVersion::getVersion(
            extensions/Translate/ffs  (1 usage found)
                GettextFFS.php  (1 usage found)
                    GettextFFS  (1 usage found)
                        getGenerator  (1 usage found)
                            565 return 'MediaWiki ' . SpecialVersion::getVersion() .
    Usage in instanceof  (1 usage found)
        mediawiki  (1 usage found)
            extensions/Lingo/src  (1 usage found)
                Lingo.php  (1 usage found)
                    Lingo  (1 usage found)
                        initExtension  (1 usage found)
                              (1 usage found)
                                77 if ( $specialPage instanceof \SpecialVersion ) {

Details

Event Timeline

Reedy created this task.May 4 2020, 7:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 4 2020, 7:36 PM

Change 594289 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Move some reused functions relating to extension additional files to trait

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

Reedy updated the task description. (Show Details)May 4 2020, 8:06 PM

Change 594289 merged by jenkins-bot:
[mediawiki/core@master] Create ExtensionInfo

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