aboutsummaryrefslogtreecommitdiffstats
path: root/opensearch_desc.php
Commit message (Collapse)AuthorAgeFilesLines
* Use namespaced classesUmherirrender2023-12-111-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statements and changes to docs done manually Change-Id: I443aada1c18c8628b02671aa9fd6f441961e5c2e
* Replace some deprecated wfExpandUrl calls with UrlUtils::expandJames D. Forrester2023-05-301-3/+7
| | | | | Bug: T319340 Change-Id: I2d81c2d7fd31bb07a2d2057361f1670cdeb8b8d0
* Replace internal Hooks::runnerUmherirrender2023-05-111-1/+4
| | | | | | | | | The Hooks class contains deprecated functions and the whole class is going to get removed, so remove the convenience function and inline the code. Bug: T335536 Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
* In Web entry points, move file scope code into a main functionTim Starling2020-06-251-78/+84
| | | | | | | | | | Avoid leaking local variables into the global scope by accident, by moving the entry point code to a function. In index.php, document the intentional $mediaWiki global so that nobody removes it by accident. Change-Id: Ie1a181ae3ebdda90cd2321f0c1b50e31fb0d586e
* Hooks::run() call site migrationTim Starling2020-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all callers of Hooks::run() to use the new HookContainer/HookRunner system. General principles: * Use DI if it is already used. We're not changing the way state is managed in this patch. * HookContainer is always injected, not HookRunner. HookContainer is a service, it's a more generic interface, it is the only thing that provides isRegistered() which is needed in some cases, and a HookRunner can be efficiently constructed from it (confirmed by benchmark). Because HookContainer is needed for object construction, it is also needed by all factories. * "Ask your friendly local base class". Big hierarchies like SpecialPage and ApiBase have getHookContainer() and getHookRunner() methods in the base class, and classes that extend that base class are not expected to know or care where the base class gets its HookContainer from. * ProtectedHookAccessorTrait provides protected getHookContainer() and getHookRunner() methods, getting them from the global service container. The point of this is to ease migration to DI by ensuring that call sites ask their local friendly base class rather than getting a HookRunner from the service container directly. * Private $this->hookRunner. In some smaller classes where accessor methods did not seem warranted, there is a private HookRunner property which is accessed directly. Very rarely (two cases), there is a protected property, for consistency with code that conventionally assumes protected=private, but in cases where the class might actually be overridden, a protected accessor is preferred over a protected property. * The last resort: Hooks::runner(). Mostly for static, file-scope and global code. In a few cases it was used for objects with broken construction schemes, out of horror or laziness. Constructors with new required arguments: * AuthManager * BadFileLookup * BlockManager * ClassicInterwikiLookup * ContentHandlerFactory * ContentSecurityPolicy * DefaultOptionsManager * DerivedPageDataUpdater * FullSearchResultWidget * HtmlCacheUpdater * LanguageFactory * LanguageNameUtils * LinkRenderer * LinkRendererFactory * LocalisationCache * MagicWordFactory * MessageCache * NamespaceInfo * PageEditStash * PageHandlerFactory * PageUpdater * ParserFactory * PermissionManager * RevisionStore * RevisionStoreFactory * SearchEngineConfig * SearchEngineFactory * SearchFormWidget * SearchNearMatcher * SessionBackend * SpecialPageFactory * UserNameUtils * UserOptionsManager * WatchedItemQueryService * WatchedItemStore Constructors with new optional arguments: * DefaultPreferencesFactory * Language * LinkHolderArray * MovePage * Parser * ParserCache * PasswordReset * Router setHookContainer() now required after construction: * AuthenticationProvider * ResourceLoaderModule * SearchEngine Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
* docs: Improve "Entry points" documentation pageTimo Tijhof2020-02-041-1/+7
| | | | | | | | | | | | Turn this into a doc group, and let the descriptions come directly from the files in question. This makes the list easier to maintain, and alsom means that the overview page becomes discoverable whenever one is looking at the entry point file as well. Previously the doc page pointed to the entry points, but not the other way around. This is also fixed. Bug: T244294 Change-Id: I891c5a37e17592edc1136d7367949927121c8bc8
* Add MW_REST_API and MW_ENTRY_POINTTim Starling2019-09-031-0/+2
| | | | | | | | | | | | | Define the global constant MW_REST_API in rest.php, by analogy with MW_API. Also generalize this by adding MW_ENTRY_POINT, which contains the entry script name, "cli" or "unknown". This allows tests such as if ( MW_ENTRY_POINT !== 'index' ) which is probably what is really intended by defined('MW_API') in many cases. Change-Id: I24099f4cdd170de17afd6e1bbad67c9b204071fc
* entrypoint: Avoid random Doxygen block from api.php and opensearch_desc.phpTimo Tijhof2019-07-081-11/+10
| | | | | | | | | | | | | | These two entry points have themselves partly indexed by Doxygen in a very strange way where these two comments cause part of an if-statement to be seen as the name of a local variable. Probably due to some kind of bad interaction with the maintenance/mwdoc-filter.php filter applied to the file before it gets indexed. Fix it for now by avoiding use of /** blocks for something that isn't a class, function, class member or documented global var. Change-Id: I4903069e704c3283e6ec7a39999a489d0117cc71
* Rename CDN config variables to be generic, deprecating the old namesJames D. Forrester2019-05-241-1/+1
| | | | | | | | | Hook, methods, classes still to rename where appropriate. Bug: T104148 Depends-On: Id34339dff88bc6d1863378ac94b96b2d590b891d Depends-On: I4e2938395bcbf7956b83fff00978f09c61dcfa36 Change-Id: I7a725dae551c867a4fa7c213838d52c7fb862756
* Enforce no-session constraint in opensearch_desc.php and profileinfo.phpBrad Jorsch2018-10-031-3/+2
| | | | | | | | Attempts to use session data via these endpoints will now cause exceptions to be thrown. Bug: T127233 Change-Id: I28b080a84e7b928e4336a5a1ec770bb57b05d009
* Restore original OpenSearch namespacesLucas Werkmeister2018-06-071-2/+2
| | | | | | | | | | | | | | | | | | Though that URL may no longer resolve, the correct XML namespace for OpenSearch remains http://a9.com/-/spec/opensearch/1.1/ – see [1] and [2] for some discussion clarifying this. Similarly, the canonical namespace URL for MozSearch uses HTTP, not HTTPS, as can be seen when visiting it (via either protocol) [3]. This reverts commit 3b86cf03c162298211da2f57333bcc645123a979. [1]: https://github.com/dewitt/opensearch/issues/3 [2]: https://groups.google.com/d/msg/opensearch/8ecuX35-lEs/JR_cs0N6k68J [3]: https://www.mozilla.org/2006/browser/search/ Bug: T196643 Change-Id: I8d14660550a5c67cefc421a334502963bfd6ed3c
* Update 'OpenSearchDescription' linksSuriyaa Kudo2018-04-291-2/+2
| | | | | | | * a9.com OpenSearch website doesn't exist anymore. I replaced it with OpenSearch.org. * Change HTTP protocol for the xmlns:moz website. I removed the website redirection. Change-Id: I2c261cd654f009a9316510f2cf80944235c1af82
* Drop deprecated EnableAPI and EnableWriteAPI settingsJames D. Forrester2018-04-181-1/+1
| | | | | | | | | The siteinfo API response's 'writeapi' value is now hard-set to true, as are the ResourceLoader variables wgEnableAPI and wgEnableWriteAPI, to be deprecated later. Bug: T115414 Change-Id: I54ff9428b247ba203d67aba079149393f323d5a9
* Warn on session access in profileinfo.php and opensearch_desc.phpBrad Jorsch2016-05-051-0/+5
| | | | | | | | These are so simple there will probably be no problems, but let's set them to 'warn' for a week just to be sure. Bug: T127233 Change-Id: I04007faaf541f30dcaf2085fa86b45bea1ecb754
* Convert all array() syntax to []Kunal Mehta2016-02-171-10/+10
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Change some line comments to multi line commentsumherirrender2015-10-141-10/+11
| | | | | | | This allows empty lines inside the comment as found by the MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff Change-Id: Iac155bbda4a84562db2b452baeae9b8973899453
* wfRunHooks() -> Hooks::run() in remaining entry point filesChad Horohoe2015-04-271-1/+1
| | | | Change-Id: I074deaa7dabc9512812a0ec76a8cc2ea4535a484
* Merge OpenSearchXml extension into coreBrad Jorsch2014-11-261-7/+12
| | | | | | | | | There's really no reason for the extension to exist separately from core, and merging it reduces the risks of bitrot in both the extension (lots of deprecated functions there) and core (missing integration with PageImages and TextExtracts, for example). Change-Id: Ie0ab90902ede9499879402290006466efba479e9
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-1/+1
| | | | | | | | | | | | | Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
* Update code formattingSiebrand Mazeland2013-02-141-3/+3
| | | | Change-Id: I8741b5b979e55f38a666961a16c387586a92410e
* style: fix up commas in function argumentsAntoine Musso2013-02-061-1/+1
| | | | | | | | | | | | Fix up spaces in our function calls, we do not want spaces before a comma and try to avoid multiple commas whenever possible. Errors: * No space found after comma in function call * Space found before comma in function call Change-Id: I51aec02016f742422fa60b92ad35ba3f0ef59ba3
* Use __DIR__ instead of dirname( __FILE__ )Hoo man2012-08-271-1/+1
| | | | | | | | Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments. Running the PHP version test in maintenance/Maintenance.php earlier, so that we no longer have to stay PHP < 5.3 compatible in there. Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
* Use wfMessage instead of deprecated wfMsg*Alex Monk2012-08-181-1/+1
| | | | | | Or $this->msg in special pages. Change-Id: I774a89d646615053c8424050e42ad95601f92543
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-231-2/+16
| | | | | | Also made file documentation more consistent. Change-Id: I30e124514396f110a572467b94ca06cefd5f7b46
* Use canonical URLs (introduced in r94995) in the OpenSearch discovery thingyRoan Kattouw2011-08-191-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/95000
* Same as r48631; added "@file" when needed, also added doc in redirect.php ↵Alexandre Emsenhuber2009-03-211-0/+2
| | | | | | | and install-utils.inc Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/48658
* Revert r37272 "Send $wgMimeType mime type for Special:Search template"Brion Vibber2008-07-071-1/+1
| | | | | | | Clients will expect text/html specifically, and would not necessarily know that say application/xhtml+xml means the regular search page. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/37279
* Send $wgMimeType mime type for Special:Search templateAlexandre Emsenhuber2008-07-071-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/37272
* OpenSearch cleanup; Firefox now sends you to the search page for empty ↵Brion Vibber2008-07-011-27/+67
| | | | | | | | | | | | | | | searches instead of the domain root (which may not even be a wiki). This is done by adding the <moz:SearchForm> extension element with the Special:Search URL. Removed the 24-character truncation on ShortName... neither Firefox nor IE seems to care about longer names, but both expect the ShortName and <link> title to match, and will think you have a duplicate search provider if they don't match because only one was truncated. (Besides, 24 was longer than the spec's limit of 16 -- why bother limiting at all if not to spec?) The JSON suggestions are now no longer included in the OpenSearch description if the API is disabled, since the interface won't work. Generally removed some hardcoded escape-then-stick-vars-in-string-output eww... Extension hooks now have a more general opportunity to alter or replace the OpenSearch URLs by tying into the OpenSearchUrls hook. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/36869
* Ajax suggestions:Robert Stojnić2008-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * check in a new ajax suggestion engine (mwsuggest.js) which uses OpenSearch to fetch results (by default via API), this should deprecated the old ajaxsearch thingy * extend PrefixSearchBackend hook to accept multiple namespaces for future lucene use (default implementation however can still process only one) * Added to preferences, also a feature to turn it on/off for every input (disabled atm until I work out browser issues completely) * WMF wikis probably won't be using API to fetch results, but a custom php wrapper that just forwards the request to appropriate lucene daemon, added support for that SpecialSearch: * moved stuff out of SpecialSearch to SearchEngine, like snippet highlighting and such * support for additional interwiki results, e.g. title matches from other projects shown in a separate box on the right * todo: interwiki box doesn't have standard prev/next links to avoid clutter and unintuitive interface * support for related articles Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/33400
* Tweak up last commit about opensearch desc to be nicer. Cleaner message ↵Brion Vibber2008-02-271-2/+1
| | | | | | | name, use wfMsgForContent, remove an obsolete line. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/31337
* * (bug 12723) OpenSearch description name now uses more compact language codeBrion Vibber2008-02-271-2/+9
| | | | | | | | | | | | | | | | | | to avoid passing the length limit as often, is customizable per site via 'opensearch-shortname' message. Note that the spec actually says ShortName should be trimmed to *16* chars, which is pretty awful -- 'Wikimedia Commons' doesn't even fit. I haven't changed the current trimming (to 24 characters). Note that Firefox uses the longer 'Description' field for its 'add' menu item, but the ShortName for the actual item once you add it to the menu. Possibly should have separate description and shortname thingies and do some smarter trimming. Sigh. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/31336
* * (bug 12935, 12981) Fully-qualify archive URLs in delete, revert messagesBrion Vibber2008-02-131-5/+2
| | | | | | | Replaced a bunch of instances of 'if-this-is-not-fully-qualified-prepend-$wgServer' with a function, wfExpandUrl() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/30898
* Apply live hack from Wikimedia codebase: bump HTTP cache expiry on ↵Brion Vibber2008-01-291-1/+2
| | | | | | | OpenSearch results from 5 to 10 minutes, and send a Cache-Control header as well as Expires for better squid support Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/30233
* * Made special page names case-insensitive and localisable. Care has been ↵Tim Starling2006-10-301-1/+1
| | | | | | | | | taken to maintain backwards compatibility. * Used special page subpages in a few more places, instead of query parameters Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/17300
* fixed suggest URLYuri Astrakhan2006-10-161-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/17042
* * Added search suggestions link.Yuri Astrakhan2006-10-161-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/17040
* Add "title" to the opensearch link to allow automatic adding of the search ↵Jens Frank2006-10-091-2/+5
| | | | | | | engine in Firefox 2 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/16898
* another minor fixTim Starling2006-08-201-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/16139
* favicon fixTim Starling2006-08-201-1/+7
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/16138
* Experimental OpenSearch descriptionTim Starling2006-08-201-0/+32
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/16137