2008-01-28 19:05:26 +00:00
|
|
|
<?php
|
2010-02-23 12:30:23 +00:00
|
|
|
/**
|
2010-12-22 20:52:06 +00:00
|
|
|
*
|
2008-01-28 19:05:26 +00:00
|
|
|
*
|
2010-08-07 19:59:42 +00:00
|
|
|
* Created on Oct 22, 2006
|
|
|
|
|
*
|
2012-07-15 20:13:02 +00:00
|
|
|
* Copyright © 2008 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
|
2008-01-28 19:05:26 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2010-06-21 13:13:32 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-01-28 19:05:26 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2010-08-07 19:59:42 +00:00
|
|
|
*
|
|
|
|
|
* @file
|
2008-01-28 19:05:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-05-11 22:30:18 +00:00
|
|
|
* API PHP's var_export() output formatter
|
2014-08-27 19:41:05 +00:00
|
|
|
* @deprecated since 1.24
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup API
|
2008-01-28 19:05:26 +00:00
|
|
|
*/
|
|
|
|
|
class ApiFormatDbg extends ApiFormatBase {
|
|
|
|
|
|
|
|
|
|
public function getMimeType() {
|
2010-01-23 22:52:40 +00:00
|
|
|
// This looks like it should be text/plain, but IE7 is so
|
|
|
|
|
// brain-damaged it tries to parse text/plain as HTML if it
|
|
|
|
|
// contains HTML tags. Using MIME text/text works around this bug
|
2008-01-28 19:05:26 +00:00
|
|
|
return 'text/text';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function execute() {
|
2014-08-08 10:00:22 +00:00
|
|
|
$this->markDeprecated();
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->printText( var_export( $this->getResultData(), true ) );
|
2008-01-28 19:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
API: HTMLize and internationalize the help, add Special:ApiHelp
The existing API help, formatted as basically a plain-text document
embedded in XML and with a little bolding and a few links
syntax-highlighted in after the fact, works ok for experienced programmers
but isn't at all newbie-friendly. Further, all the help is hard-coded in
English, which isn't very friendly to non-English speakers.
So let's rewrite it. The help text is now obtained from i18n messages
and output in HTML, with the default display consisting of help for a
single module with links to help for other modules. This, of course,
necessitates deprecating many of the existing help-related methods and
hooks and replacing them with new ones, but backwards compatibility is
maintained for almost everything.
At the same time, action=paraminfo also needs to support the
'description' and other help-related fields being output in wikitext or
HTML, and I11cb063d (to access all modules via the 'modules' parameter
instead of having 'modules', 'formatmodules', 'querymodules', and so on)
is folded in.
And we also add Special:ApiHelp. When directly accessed, it simply
redirects to api.php with appropriate parameters. But it's also
transcludable to allow up-to-date API help text to be included within
the on-wiki documentation.
Note this patch doesn't actually add i18n messages for any API modules
besides ApiMain and ApiHelp. That will come in a followup patch, but for
the moment the backwards-compatibility code handles them nicely.
While we're messing with the documentation, we may as well add the
"internal" flag requested in bug 62905 (although the 'includeinternal'
parameter it also requests doesn't make much sense anymore) and a
"deprecated" flag that's needed by several modules now.
Bug: 30936
Bug: 38126
Bug: 42343
Bug: 45641
Bug: 62905
Bug: 63211
Change-Id: Ib14c00df06d85c2f6364d83b2b10ce34c7f513cc
2014-09-16 17:54:01 +00:00
|
|
|
public function isDeprecated() {
|
|
|
|
|
return true;
|
2008-01-28 19:05:26 +00:00
|
|
|
}
|
|
|
|
|
}
|