1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#!/bin/sh
# svn co http://svn.php.net/repository/phpdoc/modules/doc-en
# pear install doc.php.net/phd
# pear install doc.php.net/phd_php
# cd doc-en
# Set the path to PHP from environment or use which to discover it
if [ "$PHP" == "" ];
then
PHP=$(which php 2>/dev/null)
fi
# Sets the path to PHD from environment or use which to discover it
if [ "$PHD" == "" ];
then
PHD=$(which phd 2>/dev/null)
fi
# Sets the browser application from environment or falls back on open if it is found
if [ "$BROWSER" == "" ];
then
BROWSER=$(which open 2>/dev/null)
fi
# Test for executability of PHP
if [ ! -x "$PHP" ];
then
echo "Cannot execute PHP ($PHP) !"
exit 1
fi
# Test for executability of PHD
if [ ! -x "$PHD" ];
then
echo "Cannot execute $PHD, is PHD installed ?"
exit 2
fi
# Configure Documentation
$PHP doc-base/configure.php --enable-xml-details
# Generate Documentation
$PHD --docbook doc-base/.manual.xml --package PHP --format xhtml
# Opens a browser if it is appropriate to do so
if [ "$BROWSER" != "" ];
then
if [ -f output/php-chunked-xhtml/index.html ];
then
$BROWSER output/php-chunked-xhtml/index.html 2>/dev/null 1>/dev/null </dev/null &
fi
fi
|