Introduce includes/utils directory
These are classes that provide facilities for use by any caller, are independent of user interface, and have a limited set of dependencies on the rest of MediaWiki. See the README file for a more precise definition. These classes cannot go in includes/libs because of a dependency on the MediaWiki framework, such as wfDebug() or MWException, but they are otherwise similar. I thought it would be useful to put them in their own directory, to make them more discoverable, and as part of a general program of reducing clutter in the base includes/ directory. I've probably missed a few classes which could be included here, but the following classes were considered and were rejected for now: * Fallback: single caller only * GitInfo: getViewers() has inappropriate dependencies * HttpFunctions: depends on configuration, $wgTitle * PoolCounter: depends on configuration * CacheHelper: depends on IContextSource, wfMemc() Also moved a couple of classes into libs/ instead, where that seemed to be more appropriate. Change-Id: I274cff805b7d694b728a89b764a049cd62d320fe
This commit is contained in:
parent
64d0dc06a0
commit
e4bcbe722e
17 changed files with 40 additions and 29 deletions
|
|
@ -33,7 +33,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'AjaxDispatcher' => 'includes/AjaxDispatcher.php',
|
||||
'AjaxResponse' => 'includes/AjaxResponse.php',
|
||||
'AlphabeticPager' => 'includes/Pager.php',
|
||||
'ArrayUtils' => 'includes/ArrayUtils.php',
|
||||
'Article' => 'includes/Article.php',
|
||||
'AtomFeed' => 'includes/Feed.php',
|
||||
'AuthPlugin' => 'includes/AuthPlugin.php',
|
||||
|
|
@ -47,28 +46,17 @@ $wgAutoloadLocalClasses = array(
|
|||
'Categoryfinder' => 'includes/Categoryfinder.php',
|
||||
'CategoryPage' => 'includes/CategoryPage.php',
|
||||
'CategoryViewer' => 'includes/CategoryViewer.php',
|
||||
'CdbFunctions' => 'includes/Cdb_PHP.php',
|
||||
'CdbReader' => 'includes/Cdb.php',
|
||||
'CdbReader_DBA' => 'includes/Cdb.php',
|
||||
'CdbReader_PHP' => 'includes/Cdb_PHP.php',
|
||||
'CdbWriter' => 'includes/Cdb.php',
|
||||
'CdbWriter_DBA' => 'includes/Cdb.php',
|
||||
'CdbWriter_PHP' => 'includes/Cdb_PHP.php',
|
||||
'ChangesFeed' => 'includes/ChangesFeed.php',
|
||||
'ChangeTags' => 'includes/ChangeTags.php',
|
||||
'ChannelFeed' => 'includes/Feed.php',
|
||||
'Collation' => 'includes/Collation.php',
|
||||
'ConcatenatedGzipHistoryBlob' => 'includes/HistoryBlob.php',
|
||||
'ConfEditor' => 'includes/ConfEditor.php',
|
||||
'ConfEditorParseError' => 'includes/ConfEditor.php',
|
||||
'ConfEditorToken' => 'includes/ConfEditor.php',
|
||||
'Cookie' => 'includes/Cookie.php',
|
||||
'CookieJar' => 'includes/Cookie.php',
|
||||
'CurlHttpRequest' => 'includes/HttpFunctions.php',
|
||||
'DeprecatedGlobal' => 'includes/DeprecatedGlobal.php',
|
||||
'DerivativeRequest' => 'includes/WebRequest.php',
|
||||
'DiffHistoryBlob' => 'includes/HistoryBlob.php',
|
||||
'DoubleReplacer' => 'includes/StringUtils.php',
|
||||
'DummyLinker' => 'includes/Linker.php',
|
||||
'Dump7ZipOutput' => 'includes/Export.php',
|
||||
'DumpBZip2Output' => 'includes/Export.php',
|
||||
|
|
@ -84,7 +72,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'EditPage' => 'includes/EditPage.php',
|
||||
'EmailNotification' => 'includes/UserMailer.php',
|
||||
'ErrorPageError' => 'includes/Exception.php',
|
||||
'ExplodeIterator' => 'includes/StringUtils.php',
|
||||
'FakeTitle' => 'includes/FakeTitle.php',
|
||||
'Fallback' => 'includes/Fallback.php',
|
||||
'FatalError' => 'includes/Exception.php',
|
||||
|
|
@ -99,8 +86,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'FormOptions' => 'includes/FormOptions.php',
|
||||
'FormSpecialPage' => 'includes/SpecialPage.php',
|
||||
'GitInfo' => 'includes/GitInfo.php',
|
||||
'HashRing' => 'includes/HashRing.php',
|
||||
'HashtableReplacer' => 'includes/StringUtils.php',
|
||||
'HistoryBlob' => 'includes/HistoryBlob.php',
|
||||
'HistoryBlobCurStub' => 'includes/HistoryBlob.php',
|
||||
'HistoryBlobStub' => 'includes/HistoryBlob.php',
|
||||
|
|
@ -142,7 +127,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'IncludableSpecialPage' => 'includes/SpecialPage.php',
|
||||
'IndexPager' => 'includes/Pager.php',
|
||||
'Interwiki' => 'includes/interwiki/Interwiki.php',
|
||||
'IP' => 'includes/IP.php',
|
||||
'LCStore' => 'includes/cache/LocalisationCache.php',
|
||||
'LCStore_Accel' => 'includes/cache/LocalisationCache.php',
|
||||
'LCStore_CDB' => 'includes/cache/LocalisationCache.php',
|
||||
|
|
@ -157,16 +141,13 @@ $wgAutoloadLocalClasses = array(
|
|||
'MagicWord' => 'includes/MagicWord.php',
|
||||
'MagicWordArray' => 'includes/MagicWord.php',
|
||||
'MailAddress' => 'includes/UserMailer.php',
|
||||
'MappedIterator' => 'includes/MappedIterator.php',
|
||||
'MediaWiki' => 'includes/Wiki.php',
|
||||
'MediaWiki_I18N' => 'includes/SkinTemplate.php',
|
||||
'Message' => 'includes/Message.php',
|
||||
'MessageBlobStore' => 'includes/MessageBlobStore.php',
|
||||
'MimeMagic' => 'includes/MimeMagic.php',
|
||||
'MWCryptRand' => 'includes/MWCryptRand.php',
|
||||
'MWException' => 'includes/Exception.php',
|
||||
'MWExceptionHandler' => 'includes/Exception.php',
|
||||
'MWFunction' => 'includes/MWFunction.php',
|
||||
'MWHookException' => 'includes/Hooks.php',
|
||||
'MWHttpRequest' => 'includes/HttpFunctions.php',
|
||||
'MWInit' => 'includes/Init.php',
|
||||
|
|
@ -196,9 +177,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'ReadOnlyError' => 'includes/Exception.php',
|
||||
'RedirectSpecialArticle' => 'includes/SpecialPage.php',
|
||||
'RedirectSpecialPage' => 'includes/SpecialPage.php',
|
||||
'RegexlikeReplacer' => 'includes/StringUtils.php',
|
||||
'ReplacementArray' => 'includes/StringUtils.php',
|
||||
'Replacer' => 'includes/StringUtils.php',
|
||||
'ReverseChronologicalPager' => 'includes/Pager.php',
|
||||
'RevisionItem' => 'includes/RevisionList.php',
|
||||
'RevisionItemBase' => 'includes/RevisionList.php',
|
||||
|
|
@ -207,8 +185,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'RevisionList' => 'includes/RevisionList.php',
|
||||
'RSSFeed' => 'includes/Feed.php',
|
||||
'Sanitizer' => 'includes/Sanitizer.php',
|
||||
'ScopedCallback' => 'includes/ScopedCallback.php',
|
||||
'ScopedPHPTimeout' => 'includes/ScopedPHPTimeout.php',
|
||||
'SiteConfiguration' => 'includes/SiteConfiguration.php',
|
||||
'SiteStats' => 'includes/SiteStats.php',
|
||||
'SiteStatsInit' => 'includes/SiteStats.php',
|
||||
|
|
@ -230,7 +206,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'StatCounter' => 'includes/StatCounter.php',
|
||||
'Status' => 'includes/Status.php',
|
||||
'StreamFile' => 'includes/StreamFile.php',
|
||||
'StringUtils' => 'includes/StringUtils.php',
|
||||
'StubContLang' => 'includes/StubObject.php',
|
||||
'StubObject' => 'includes/StubObject.php',
|
||||
'StubUserLang' => 'includes/StubObject.php',
|
||||
|
|
@ -241,7 +216,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'TitleArray' => 'includes/TitleArray.php',
|
||||
'TitleArrayFromResult' => 'includes/TitleArray.php',
|
||||
'ThrottledError' => 'includes/Exception.php',
|
||||
'UIDGenerator' => 'includes/UIDGenerator.php',
|
||||
'UnlistedSpecialPage' => 'includes/SpecialPage.php',
|
||||
'UploadSourceAdapter' => 'includes/Import.php',
|
||||
'UppercaseCollation' => 'includes/Collation.php',
|
||||
|
|
@ -274,10 +248,7 @@ $wgAutoloadLocalClasses = array(
|
|||
'XmlJsCode' => 'includes/Xml.php',
|
||||
'XMLReader2' => 'includes/Import.php',
|
||||
'XmlSelect' => 'includes/Xml.php',
|
||||
'XmlTypeCheck' => 'includes/XmlTypeCheck.php',
|
||||
'ZhClient' => 'includes/ZhClient.php',
|
||||
'ZipDirectoryReader' => 'includes/ZipDirectoryReader.php',
|
||||
'ZipDirectoryReaderError' => 'includes/ZipDirectoryReader.php',
|
||||
|
||||
# includes/actions
|
||||
'CachedAction' => 'includes/actions/CachedAction.php',
|
||||
|
|
@ -711,6 +682,8 @@ $wgAutoloadLocalClasses = array(
|
|||
'JSParser' => 'includes/libs/jsminplus.php',
|
||||
'JSToken' => 'includes/libs/jsminplus.php',
|
||||
'JSTokenizer' => 'includes/libs/jsminplus.php',
|
||||
'ScopedPHPTimeout' => 'includes/libs/ScopedPHPTimeout.php',
|
||||
'XmlTypeCheck' => 'includes/libs/XmlTypeCheck.php',
|
||||
|
||||
# includes/libs/lessphp
|
||||
'lessc' => 'includes/libs/lessc.inc.php',
|
||||
|
|
@ -1069,6 +1042,35 @@ $wgAutoloadLocalClasses = array(
|
|||
'UploadStashWrongOwnerException' => 'includes/upload/UploadStash.php',
|
||||
'UploadStashNoSuchKeyException' => 'includes/upload/UploadStash.php',
|
||||
|
||||
# includes/utils
|
||||
'ArrayUtils' => 'includes/utils/ArrayUtils.php',
|
||||
'CdbFunctions' => 'includes/utils/Cdb_PHP.php',
|
||||
'CdbReader' => 'includes/utils/Cdb.php',
|
||||
'CdbReader_DBA' => 'includes/utils/Cdb.php',
|
||||
'CdbReader_PHP' => 'includes/utils/Cdb_PHP.php',
|
||||
'CdbWriter' => 'includes/utils/Cdb.php',
|
||||
'CdbWriter_DBA' => 'includes/utils/Cdb.php',
|
||||
'CdbWriter_PHP' => 'includes/utils/Cdb_PHP.php',
|
||||
'ConfEditor' => 'includes/utils/ConfEditor.php',
|
||||
'ConfEditorParseError' => 'includes/utils/ConfEditor.php',
|
||||
'ConfEditorToken' => 'includes/utils/ConfEditor.php',
|
||||
'DoubleReplacer' => 'includes/utils/StringUtils.php',
|
||||
'ExplodeIterator' => 'includes/utils/StringUtils.php',
|
||||
'HashRing' => 'includes/utils/HashRing.php',
|
||||
'HashtableReplacer' => 'includes/utils/StringUtils.php',
|
||||
'IP' => 'includes/utils/IP.php',
|
||||
'MWCryptRand' => 'includes/utils/MWCryptRand.php',
|
||||
'MWFunction' => 'includes/utils/MWFunction.php',
|
||||
'MappedIterator' => 'includes/utils/MappedIterator.php',
|
||||
'RegexlikeReplacer' => 'includes/utils/StringUtils.php',
|
||||
'ReplacementArray' => 'includes/utils/StringUtils.php',
|
||||
'Replacer' => 'includes/utils/StringUtils.php',
|
||||
'ScopedCallback' => 'includes/utils/ScopedCallback.php',
|
||||
'StringUtils' => 'includes/utils/StringUtils.php',
|
||||
'UIDGenerator' => 'includes/utils/UIDGenerator.php',
|
||||
'ZipDirectoryReader' => 'includes/utils/ZipDirectoryReader.php',
|
||||
'ZipDirectoryReaderError' => 'includes/utils/ZipDirectoryReader.php',
|
||||
|
||||
# languages
|
||||
'ConverterRule' => 'languages/LanguageConverter.php',
|
||||
'FakeConverter' => 'languages/Language.php',
|
||||
|
|
|
|||
9
includes/utils/README
Normal file
9
includes/utils/README
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
The classes in this directory are general utilities for use by any part of
|
||||
MediaWiki. They do not favour any particular user interface and are not
|
||||
constrained to serve any particular feature. This is similar to includes/libs,
|
||||
except that some dependency on the MediaWiki framework (such as the use of
|
||||
MWException, Status or wfDebug()) disqualifies them from use outside of
|
||||
MediaWiki without modification.
|
||||
|
||||
Utilities should not use global configuration variables, rather they should rely
|
||||
on the caller to configure their behaviour.
|
||||
Loading…
Reference in a new issue