* @version first release */ # # Variables / Configuration # if( php_sapi_name() != 'cli' ) { die( "Run me from the command line." ); } /** Phpdoc script with full path */ #$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 = "{$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/'; $mwPath = "{$here}{$sep}"; /** MediaWiki subpaths */ $mwPathI = $mwPath.'includes/'; $mwPathM = $mwPath.'maintenance/'; $mwPathS = $mwPath.'skins/'; $mwBaseFiles = $mwPath.'*php '; /** Variable to get user input */ $input = ''; /** shell command that will be run */ $command = ''; # # Functions # function readaline( $prompt = '') { print $prompt; $fp = fopen( "php://stdin", "r" ); $resp = trim( fgets( $fp, 1024 ) ); fclose( $fp ); return $resp; } # # Main ! # if( is_array( $argv ) && isset( $argv[1] ) && $argv[1] == '--all' ) { # Quick option $input = 0; } else { print <<