# Variables / Configuration
#
+if( php_sapi_name() != 'cli' ) {
+ die( "Run me from the command line." );
+}
+
/** Phpdoc script with full path */
-$pdExec = '/usr/bin/phpdoc';
+#$pdExec = '/usr/bin/phpdoc';
+$pdExec = 'phpdoc';
+
+/** Figure out the base directory. */
+$sep = DIRECTORY_SEPARATOR;
+$here = dirname( dirname( __FILE__ ) ) . $sep;
+
/** where Phpdoc should output documentation */
-$pdOutput = '/var/www/mwdoc/';
+#$pdOutput = '/var/www/mwdoc/';
+$pdOutput = "{$here}{$sep}docs{$sep}html";
/** Some more Phpdoc settings */
-//$pdOthers = ' -dn \'MediaWiki\' ';
-$pdOthers .= ' --title \'Mediawiki generated documentation\' -o \'HTML:frames:DOM/earthli\' ';
+$pdOthers = ' -dn \'MediaWiki\' ';
+$pdOthers .= ' --title \'MediaWiki generated documentation\' -o \'HTML:frames:DOM/earthli\' --ignore AdminSettings.php,LocalSettings.php,tests/LocalTestSettings.php --parseprivate on ';
-/** Mediawiki location */
-$mwPath = '/var/www/mediawiki/';
+/** MediaWiki location */
+#$mwPath = '/var/www/mediawiki/';
+$mwPath = "{$here}{$sep}";
-/** Mediawiki subpaths */
+/** MediaWiki subpaths */
$mwPathI = $mwPath.'includes/';
$mwPathM = $mwPath.'maintenance/';
$mwPathS = $mwPath.'skins/';
# Main !
#
-print <<<END
+unset( $file );
+
+if( is_array( $argv ) && isset( $argv[1] ) ) {
+ switch( $argv[1] ) {
+ case '--all': $input = 0; break;
+ case '--includes': $input = 1; break;
+ case '--maintenance': $input = 2; break;
+ case '--skins': $input = 3; break;
+ case '--file':
+ $input = 4;
+ if( isset( $argv[2] ) ) {
+ $file = $argv[2];
+ }
+ break;
+ }
+}
+
+if( $input === '' ) {
+ print <<<END
Several documentation possibilities:
0 : whole documentation (1 + 2 + 3)
1 : only includes
4 : only a given file
END;
-while ( !is_numeric($input) )
-{
- $input = readaline( "\nEnter your choice [0]:" );
- if($input == '') {
- $input = 0;
+ while ( !is_numeric($input) )
+ {
+ $input = readaline( "\nEnter your choice [0]:" );
+ if($input == '') {
+ $input = 0;
+ }
}
}
$command .= "-d $mwPathS ";
break;
case 4:
- $file = readaline("\Enter file name $mwPath");
+ if( !isset( $file ) ) {
+ $file = readaline("\Enter file name $mwPath");
+ }
$command .= ' -f '.$mwPath.$file;
}
END;
-# phpdoc -d ./mediawiki/includes/ ./mediawiki/maintenance/ -f ./mediawiki/*php -t ./mwdoc/ -dn 'MediaWiki' --title 'Mediawiki generated documentation' -o 'HTML:frames:DOM/earthli'
+# phpdoc -d ./mediawiki/includes/ ./mediawiki/maintenance/ -f ./mediawiki/*php -t ./mwdoc/ -dn 'MediaWiki' --title 'MediaWiki generated documentation' -o 'HTML:frames:DOM/earthli'
-# phpdoc -f ./mediawiki/includes/GlobalFunctions.php -t ./mwdoc/ -dn 'MediaWiki' --title 'Mediawiki generated documentation' -o 'HTML:frames:DOM/earthli'
+# phpdoc -f ./mediawiki/includes/GlobalFunctions.php -t ./mwdoc/ -dn 'MediaWiki' --title 'MediaWiki generated documentation' -o 'HTML:frames:DOM/earthli'
?>