36require_once __DIR__ .
'/Maintenance.php';
48 parent::__construct();
55 'Pass a MediaWiki version',
58 'Whether to generate man files' );
60 "Only process given file or directory. Multiple values " .
61 "accepted with comma separation. Path relative to \$IP.",
64 'Path to write doc to',
67 'Ignore extensions' );
74 protected function init() {
77 $this->doxygen = $this->
getOption(
'doxygen',
'doxygen' );
78 $this->mwVersion = $this->
getOption(
'version',
'master' );
81 $inputs = explode(
',', $this->
getOption(
'file',
'' ) );
82 foreach ( $inputs as
$input ) {
83 # Doxygen inputs are space separted and double quoted
84 $this->input .=
" \"$IP/$input\"";
93 $IP .
'/maintenance/mwdoc-filter.php'
96 $this->
template = $IP .
'/maintenance/Doxyfile';
103 $this->excludePatterns = [];
104 if ( $this->
hasOption(
'no-extensions' ) ) {
105 $this->excludePatterns[] =
'extensions';
108 $this->doDot = shell_exec(
'which dot' );
109 $this->doMan = $this->
hasOption(
'generate-man' );
117 # Build out directories we want to exclude
119 foreach ( $this->excludes as $item ) {
120 $exclude .=
" $IP/$item";
123 $excludePatterns = implode(
' ', $this->excludePatterns );
125 $conf = strtr( file_get_contents( $this->
template ),
127 '{{OUTPUT_DIRECTORY}}' => $this->
output,
128 '{{STRIP_FROM_PATH}}' => $IP,
129 '{{CURRENT_VERSION}}' => $this->mwVersion,
130 '{{INPUT}}' => $this->input,
131 '{{EXCLUDE}}' => $exclude,
132 '{{EXCLUDE_PATTERNS}}' => $excludePatterns,
133 '{{HAVE_DOT}}' => $this->doDot ?
'YES' :
'NO',
134 '{{GENERATE_MAN}}' => $this->doMan ?
'YES' :
'NO',
135 '{{INPUT_FILTER}}' => $this->inputFilter,
139 $tmpFile = tempnam(
wfTempDir(),
'MWDocGen-' );
140 if ( file_put_contents( $tmpFile, $conf ) ===
false ) {
141 $this->
error(
"Could not write doxygen configuration to file $tmpFile\n",
145 $command = $this->doxygen .
' ' . $tmpFile;
146 $this->
output(
"Executing command:\n$command\n" );
152---------------------------------------------------
153Doxygen execution finished.
154Check
above for possible errors.
156You might want to
delete the temporary file:
158---------------------------------------------------
163 if ( $exitcode !== 0 ) {
164 $this->
error(
"Something went wrong (exit: $exitcode)\n",
this section has the sole purpose of protecting the integrity of the free software distribution system
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section above
$wgPhpCli
Executable path of the PHP cli binary (php/php5).
wfTempDir()
Tries to get the system directory for temporary files.
wfEscapeShellArg()
Version of escapeshellarg() that works better on Windows.
Maintenance script that builds doxygen documentation.
__construct()
Prepare Maintenance class.
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
const DB_NONE
Constants for DB access type.
hasOption( $name)
Checks to see if a particular param exists.
addDescription( $text)
Set the description text.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
getOption( $name, $default=null)
Get an option, or return the default.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all. It could be easily changed to send incrementally if that becomes useful
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
require_once RUN_MAINTENANCE_IF_MAIN
if(is_array($mode)) switch( $mode) $input