Skip to content

Commit

Permalink
Merge pull request #1 from leonidasv/master
Browse files Browse the repository at this point in the history
Updated support for php-7.0 + dependency check
  • Loading branch information
Jmeyering authored Jun 27, 2017
2 parents 8776425 + 9152752 commit 42a8169
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions php-fpm-cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Copyright (c) 2017 Leonidas Villeneuve <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
Expand All @@ -22,13 +24,24 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

#First time execution dependency install (Ubuntu only)

if [ $(lsb_release -a 2>/dev/null | grep -c "Ubuntu") = 2 ] && [ ! -f $HOME/.php-fpm-cli ] && [ $(dpkg-query -W -f='${Status}' libfcgi0ldbl 2>/dev/null | grep -c "ok installed") = 0 ]; then
echo "This application depends on libfcgi0ldbl, which is not installed on your system. This script will install it now.";
sudo apt-get install libfcgi0ldbl;
echo ' ' > $HOME/.php-fpm-cli;
elif [ $(lsb_release -a 2>/dev/null | grep -c "Ubuntu") -eq 2 ] && [ $(dpkg-query -W -f='${Status}' libfcgi0ldbl 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo ' ' > $HOME/.php-fpm-cli;
fi


usage() {
cat <<USAGE
Usage: $(basename $0) [-connect CONN] -r <code>
Options:
-connect CONN Passed to cgi-fcgi, default: /var/run/php5-fpm.sock
examples: ip.add.re.ss:port or /path/to/php-fpm.sock
-connect CONN Passed to cgi-fcgi, default: /var/run/php/php7.0-fpm.sock
examples: ip.add.re.ss:port or /path/to/php[version]-fpm.sock
-r <code> Run PHP <code> without using script tags <?..?>
Expand All @@ -48,7 +61,7 @@ stripheaders() {
}

PHPFPMCLI_FILE="/tmp/php-fpm-cli.$$.php"
CONN="/var/run/php5-fpm.sock"
CONN="/var/run/php/php7.0-fpm.sock"
PHPCODE=""
init() {
until [ -z "$1" ]; do
Expand Down

0 comments on commit 42a8169

Please sign in to comment.