]> git.pld-linux.org Git - packages/php-dirs.git/commitdiff
- simplify
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 21 Jun 2011 11:30:09 +0000 (11:30 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php-session.sh -> 1.7

php-session.sh

index 46a2c019e618befd9d42e5a3b265258549be2952..bcab62b839b4bb3ed2bf76286de10f70ad83dbb8 100644 (file)
@@ -3,13 +3,13 @@
 [ -x /usr/sbin/tmpwatch ] || exit
 
 if [ -x /usr/bin/php ]; then
-       RUNTIME5=$(/usr/bin/php -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null)
+       RUNTIME5=$(/usr/bin/php -r 'echo max(round(ini_get("session.gc_maxlifetime")/3600), 1);' 2> /dev/null)
 elif [ -r /etc/php/php.ini ]; then
        RUNTIME5=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php/php.ini)
 fi
 
 if [ -x /usr/bin/php4 ]; then
-       RUNTIME4=$(/usr/bin/php4 -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null)
+       RUNTIME4=$(/usr/bin/php4 -r 'echo max(round(ini_get("session.gc_maxlifetime")/3600), 1);' 2> /dev/null)
 elif [ -r /etc/php4/php.ini ]; then
        RUNTIME4=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php4/php.ini)
 fi
This page took 0.034935 seconds and 4 git commands to generate.