Skip to content

Commit ea64202

Browse files
Ricardo Fweltling
Ricardo F
authored andcommitted
Update _bits_per_char to use with new PHP 7.1. or greater
Fix typo Remove references to PHP lower than 7.1
1 parent 54ca2e7 commit ea64202

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

ext/session/mod_files.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bash
22

33
if [[ "$2" = "" ]] || [[ "$3" = "" ]]; then
4-
echo "Usage: $0 BASE_DIRECTORY DEPTH HASH_BITS"
4+
echo "Usage: $0 BASE_DIRECTORY DEPTH BITS_PER_CHAR"
55
echo "BASE_DIRECTORY will be created if it doesn't exist"
66
echo "DEPTH must be an integer number >0"
7-
echo "HASH_BITS(session.hash_bits_per_character) should be one of 4, 5, or 6"
7+
echo "BITS_PER_CHAR(session.sid_bits_per_character) should be one of 4, 5, or 6."
8+
# http://php.net/manual/en/session.configuration.php#ini.session.sid-bits-per-character
89
exit 1
910
fi
1011

@@ -18,15 +19,15 @@ fi
1819

1920
directory="$1"
2021
depth="$2"
21-
hashbits="$3"
22+
bitsperchar="$3"
2223

2324
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
2425

25-
if [[ "$hashbits" -ge "5" ]]; then
26+
if [[ "$bitsperchar" -ge "5" ]]; then
2627
hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
2728
fi
2829

29-
if [[ "$hashbits" -ge "6" ]]; then
30+
if [[ "$bitsperchar" -ge "6" ]]; then
3031
hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
3132
fi
3233

@@ -56,10 +57,10 @@ if [[ ! -d $directory ]]; then
5657
fi
5758

5859

59-
echo "Creating session path in $directory with a depth of $depth for session.hash_bits_per_character = $hashbits"
60+
echo "Creating session path in $directory with a depth of $depth for session.sid_bits_per_character = $bitsperchar"
6061

6162
for i in $hash_chars; do
6263
newpath="$directory/$i"
6364
mkdir $newpath || exit 1
64-
bash $0 $newpath `expr $depth - 1` $hashbits recurse
65+
bash $0 $newpath `expr $depth - 1` $bitsperchar recurse
6566
done

0 commit comments

Comments
 (0)