Menu

[df5474]: / src / pyrus.sh  Maximize  Restore  History

Download this file

49 lines (39 with data), 1.1 kB

 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
#!/bin/bash
#install pyrus specific to the given php version
# automatically tries to download latest pyrus version if
# there is none in bzips/
if [ $# -lt 2 ] ; then
echo "pass version and PHP installation directory as parameters"
exit 1
fi
version="$1"
instdir="$2"
if [ ! -d "$instdir" ]; then
echo "PHP installation directory does not exist: $instdir"
exit 2
fi
pwd=`pwd`
cd "`dirname "$0"`"
basedir=`pwd`
cd "$pwd"
pyrusphar="$basedir/bzips/pyrus.phar"
pyrustarget="$instdir/pyrus.phar"
if [ ! -f "$pyrusphar" ]; then
#download pyrus from svn
wget -O "$pyrusphar"\
"http://pear2.php.net/pyrus.phar"
fi
if [ ! -f "$pyrusphar" ]; then
echo "Please put pyrus.phar into bzips/"
exit 3
fi
cp "$pyrusphar" "$pyrustarget"
mkdir -p "$instdir/pear"
pyrusbin="$instdir/bin/pyrus"
echo '#!/bin/sh'> "$pyrusbin"
echo "\"$instdir/bin/php\" \"$pyrustarget\" \"$instdir/pear\" \$@ " >> "$pyrusbin"
chmod +x "$pyrusbin"
"$pyrusbin" set php_prefix "$instdir/bin/"
#symlink
ln -sf "$pyrusbin" "$instdir/../bin/pyrus-$version"
echo "include_path=\".:$instdir/pear/php/\"" >> "$instdir/lib/php.ini"
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.