]> git.pld-linux.org Git - packages/php-dirs.git/blame - php-session.sh
- release 3
[packages/php-dirs.git] / php-session.sh
CommitLineData
ee96ae59 1#!/bin/sh
c29d80f3
TP
2
3[ -x /usr/sbin/tmpwatch ] || exit
4
5if [ -x /usr/bin/php ]; then
a77f9786 6 RUNTIME5=$(/usr/bin/php -r 'echo max(round(ini_get("session.gc_maxlifetime")/3600), 1);' 2> /dev/null)
ee96ae59 7elif [ -r /etc/php/php.ini ]; then
943a825c 8 RUNTIME5=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php/php.ini)
ee96ae59
AM
9fi
10
c29d80f3 11if [ -x /usr/bin/php4 ]; then
a77f9786 12 RUNTIME4=$(/usr/bin/php4 -r 'echo max(round(ini_get("session.gc_maxlifetime")/3600), 1);' 2> /dev/null)
ee96ae59 13elif [ -r /etc/php4/php.ini ]; then
943a825c 14 RUNTIME4=$(awk -F"=" '/^session.gc_maxlifetime[ \t]*=/ { t=sprintf("%d", ($2/3600)); if (t<1) { t=1; }; print t; exit;}' /etc/php4/php.ini)
ee96ae59
AM
15fi
16
e6693581 17[ -z "$RUNTIME5" ] && [ -z "$RUNTIME4" ] && exit
ee96ae59 18
e6693581 19[ "${RUNTIME4:-0}" -ge "${RUNTIME5:-0}" ] && RUNTIME=$((RUNTIME4)) || RUNTIME=$((RUNTIME5))
ee96ae59 20
e6693581 21/usr/sbin/tmpwatch ${RUNTIME} /var/run/php
This page took 0.524238 seconds and 4 git commands to generate.