* @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. */ $sep = DIRECTORY_SEPARATOR; $here = dirname( dirname( __FILE__ ) ) . $sep; /** 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 ! # 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 <<