From: Brion Vibber Date: Sat, 4 Sep 2004 01:58:17 +0000 (+0000) Subject: Remove hard-coded paths from documentation generation script, and don't allow running... X-Git-Tag: 1.5.0alpha1~2118 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=699a4f9b996a5f525ef79b2c7d07478ff342e1be;p=lhc%2Fweb%2Fwiklou.git Remove hard-coded paths from documentation generation script, and don't allow running except from CLI. Added --all option to skip the prompt so this can be run as part of an automated release build process. Place the generated files into docs/html. --- diff --git a/docs/html/README b/docs/html/README new file mode 100644 index 0000000000..d25b803d2e --- /dev/null +++ b/docs/html/README @@ -0,0 +1,4 @@ +This directory is for the auto-generated phpdoc documentation. +Run 'php mwdocgen.php' in the maintenance subdirectory to build the docs. + +Get phpDocumentor from http://phpdoc.org/ diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 4edbeee7a9..e4089fe527 100755 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -22,17 +22,40 @@ # 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. This is harder than it should be. */ +/** Since we're on the command line, don't trust the PWD! */ +$here = null; +$self = $_SERVER['SCRIPT_FILENAME']; +$sep = DIRECTORY_SEPARATOR; +foreach( get_included_files() as $f ) { + if( preg_match( "!^(.*)maintenance$sep$self\$!", $f, $matches ) ) { + $here = $matches[1]; + } +} +if( is_null( $here ) ) { + die( "Couldn't determine current directory.\n" ); +} + /** where Phpdoc should output documentation */ -$pdOutput = '/var/www/mwdoc/'; +#$pdOutput = '/var/www/mwdoc/'; +$pdOutput = "{$here}{$sep}docs{$sep}html"; /** Some more Phpdoc settings */ +$pdOthers = ''; //$pdOthers = ' -dn \'MediaWiki\' '; $pdOthers .= ' --title \'MediaWiki generated documentation\' -o \'HTML:frames:DOM/earthli\' '; -/** MediaWiki location */ -$mwPath = '/var/www/mediawiki/'; +/** Mediawiki location */ +#$mwPath = '/var/www/mediawiki/'; +$mwPath = "{$here}{$sep}"; /** MediaWiki subpaths */ $mwPathI = $mwPath.'includes/'; @@ -62,7 +85,11 @@ function readaline( $prompt = '') { # Main ! # -print <<