Skip to content

Instantly share code, notes, and snippets.

@pauloelr
Forked from royopa/build-machine-translation_fest
Last active August 29, 2015 14:10
Show Gist options
  • Save pauloelr/bc50885e54b64ac0dad1 to your computer and use it in GitHub Desktop.
Save pauloelr/bc50885e54b64ac0dad1 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install wget git subversion php5-cli php-pear sublime-text-installer php5-sqlite
pear install --alldeps doc.php.net/phd
pear install --alldeps doc.php.net/phd_php
# 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
cd ~
svn co https://svn.php.net/repository/phpdoc/modules/doc-pt_BR
svn co http://svn.php.net/repository/phpdoc/modules/doc-en
git clone https://github.com/php/php-src.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment