]> git.pld-linux.org Git - packages/php-dirs.git/blame - php-session.sh
- better matching and rounding. will switch to minutes if https://fedorahosted.org...
[packages/php-dirs.git] / php-session.sh
CommitLineData
ee96ae59
AM
1#!/bin/sh
2if [ -x /usr/bin/php.cli ] ; then
34676030 3 RUNTIME5=$(/usr/bin/php.cli -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null)
ee96ae59 4elif [ -r /etc/php/php.ini ]; then
34676030 5 RUNTIME5=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t;}' /etc/php/php.ini)
ee96ae59
AM
6fi
7
8if [ -x /usr/bin/php4.cli ] ; then
34676030 9 RUNTIME4=$(/usr/bin/php4.cli -r '$t = round(ini_get("session.gc_maxlifetime")/3600); if ($t<1) $t=1; echo $t;' 2> /dev/null)
ee96ae59 10elif [ -r /etc/php4/php.ini ]; then
34676030 11 RUNTIME4=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t;}' /etc/php4/php.ini)
ee96ae59
AM
12fi
13
14[ -z "$RUNTIME5" ] && RUNTIME5="1h"
15
16if [ -n "$RUNTIME5" ]; then
17 /usr/sbin/tmpwatch ${RUNTIME5} /var/run/php
18fi
19
20if [ -n "$RUNTIME4" -a "$RUNTIME5" != "$RUNTIME4" ]; then
21 /usr/sbin/tmpwatch ${RUNTIME4} /var/run/php
22fi
This page took 0.059324 seconds and 4 git commands to generate.