packages: php-dirs/php-session.sh - simplify

glen glen at pld-linux.org
Tue Jun 21 13:30:14 CEST 2011


Author: glen                         Date: Tue Jun 21 11:30:14 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- simplify

---- Files affected:
packages/php-dirs:
   php-session.sh (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: packages/php-dirs/php-session.sh
diff -u packages/php-dirs/php-session.sh:1.6 packages/php-dirs/php-session.sh:1.7
--- packages/php-dirs/php-session.sh:1.6	Sun Oct 31 02:41:10 2010
+++ packages/php-dirs/php-session.sh	Tue Jun 21 13:30:09 2011
@@ -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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-dirs/php-session.sh?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list