3 * Script to easily generate the mediawiki documentation.
5 * By default it will generate the whole documentation but you will be able to
6 * generate just some parts.
11 * Then make a selection from the menu
15 * @subpackage Maintenance
17 * @author Ashar Voultoiz <thoane@altern.org>
18 * @version first release
22 # Variables / Configuration
25 if( php_sapi_name() != 'cli' ) {
26 die( "Run me from the command line." );
29 /** Phpdoc script with full path */
30 #$pdExec = '/usr/bin/phpdoc';
33 /** Figure out the base directory. */
34 $here = dirname( dirname( __FILE__
) ) . DIRECTORY_SEPARATOR
;
36 /** where Phpdoc should output documentation */
37 #$pdOutput = '/var/www/mwdoc/';
38 $pdOutput = "{$here}docs" . DIRECTORY_SEPARATOR
. 'html';
40 /** Some more Phpdoc settings */
41 # This will be used as the default for all files that don't have a package,
42 # it's useful to set it to something like 'untagged' to hunt down and fix files
43 # that don't have a package name declared.
44 $pdOthers = " -dn MediaWiki";
45 $pdOthers .= ' --title "MediaWiki generated documentation"';
46 $pdOthers .= ' --output "HTML:Smarty:HandS"'; #,HTML:Smarty:HandS"'; ###### HTML:frames:DOM/earthli
47 $pdOthers .= ' --ignore AdminSettings.php,LocalSettings.php,tests/LocalTestSettings.php';
48 $pdOthers .= ' --parseprivate on';
49 $pdOthers .= ' --sourcecode on';
51 /** MediaWiki location */
52 #$mwPath = '/var/www/mediawiki/';
55 /** MediaWiki subpaths */
56 $mwPathI = $mwPath.'includes/';
57 $mwPathL = $mwPath.'languages/';
58 $mwPathM = $mwPath.'maintenance/';
59 $mwPathS = $mwPath.'skins/';
60 $mwBaseFiles = $mwPath.'*php ';
63 /** Variable to get user input */
65 /** shell command that will be run */
72 function readaline( $prompt = '') {
74 $fp = fopen( "php://stdin", "r" );
75 $resp = trim( fgets( $fp, 1024 ) );
86 if( is_array( $argv ) && isset( $argv[1] ) ) {
88 case '--all': $input = 0; break;
89 case '--includes': $input = 1; break;
90 case '--languages': $input = 2; break;
91 case '--maintenance': $input = 3; break;
92 case '--skins': $input = 4; break;
95 if( isset( $argv[2] ) ) {
102 if( $input === '' ) {
103 ?
>Several documentation possibilities
:
104 0 : whole
documentation (1 +
2 +
3)
109 5 : only a given file
<?php
110 while ( !is_numeric($input) )
112 $input = readaline( "\nEnter your choice [0]:" );
119 $command = 'phpdoc ';
122 $command .= " -f $mwBaseFiles -d $mwPathI,$mwPathL,$mwPathM,$mwPathS";
125 $command .= "-d $mwPathI";
128 $command .= "-d $mwPathL";
131 $command .= "-d $mwPathM";
134 $command .= "-d $mwPathS";
137 if( !isset( $file ) ) {
138 $file = readaline("Enter file name $mwPath");
140 $command .= ' -f '.$mwPath.$file;
143 $command .= " -t $pdOutput ".$pdOthers;
146 ---------------------------------------------------
147 Launching the command
:
149 <?php
echo $command ?
>
151 ---------------------------------------------------
157 ---------------------------------------------------
158 Phpdoc execution finished
.
159 Check above
for possible errors
.
162 # phpdoc -d ./mediawiki/includes/ ./mediawiki/maintenance/ -f ./mediawiki/*php -t ./mwdoc/ -dn 'MediaWiki' --title 'MediaWiki generated documentation' -o 'HTML:frames:DOM/earthli'
164 # phpdoc -f ./mediawiki/includes/GlobalFunctions.php -t ./mwdoc/ -dn 'MediaWiki' --title 'MediaWiki generated documentation' -o 'HTML:frames:DOM/earthli'