Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Be more verbose.

git-svn-id: http://svn.php.net/repository/pear/pear-core/pear/pear-core/trunk@286659 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 455d607baa0462b6867836efb832ff0011d5d318 1 parent 3221bd9
dufuz authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 make-command-xml.php
View
12 make-command-xml.php
@@ -4,15 +4,20 @@
* Outputs the XML to stdout.
*/
+echo "Starting the XML generation process\n\n";
+
// Name of the command, eg 'Remote' for Remote.php's XML output
$dir = 'PEAR/Command/';
foreach (scandir($dir) as $file) {
$file = explode('.', $file);
if (isset($file[1]) && $file[1] === 'php' && $file[0] != 'Common') {
+ echo "Generating XML for " . $file[0] . " \n";
generateXML($file[0]);
}
}
+echo "\nDone.\n";
+
function generateXML($name)
{
$file = 'PEAR/Command/' . $name . '.php';
@@ -39,7 +44,12 @@ function generateXML($name)
foreach($docs['options'] as $option => $opt_docs) {
$option = htmlentities($option, ENT_QUOTES, 'UTF-8', false);
$xml .= ' <'.$option.'>'."\n";
- $xml .= ' <shortopt>'.htmlentities($opt_docs['shortopt'], ENT_QUOTES, 'UTF-8', false)."</shortopt>\n";
+ $xml .= ' <shortopt>';
+ if (isset($opt_docs['shortopt'])) {
+ $xml .= htmlentities($opt_docs['shortopt'], ENT_QUOTES, 'UTF-8', false);
+ }
+
+ $xml .= "</shortopt>\n";
$xml .= ' <doc>'.htmlentities($opt_docs['doc'], ENT_QUOTES, 'UTF-8', false)."</doc>\n";
if (isset($opt_docs['arg']) && $opt_docs['arg'] != '') {
$xml .= ' <arg>'.htmlentities($opt_docs['arg'], ENT_QUOTES, 'UTF-8', false)."</arg>\n";
Please sign in to comment.
Something went wrong with that request. Please try again.