File: build.sh

package info (click to toggle)
php-doc 20140201-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 74,084 kB
  • ctags: 4,040
  • sloc: xml: 998,137; php: 20,812; cpp: 500; sh: 177; makefile: 63; awk: 28
file content (52 lines) | stat: -rwxr-xr-x 1,187 bytes parent folder | download
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