FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpredis/tests/startSession.php at develop · phpredis/phpredis · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
phpredis
/
phpredis
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10.2k
Code
Issues
100
Pull requests
34
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpredis
/
tests
/
startSession.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (47 loc) · 1.79 KB
Breadcrumbs
phpredis
/
tests
/
startSession.php
Copy path
File metadata and controls
56 lines (47 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
error_reporting
(
E_ERROR
|
E_WARNING
);
$
opt
=
getopt
(
''
, [
'
handler:
'
,
'
save-path:
'
,
'
id:
'
,
'
sleep:
'
,
'
max-execution-time:
'
,
'
locking-enabled:
'
,
'
lock-wait-time:
'
,
'
lock-retries:
'
,
'
lock-expires:
'
,
'
data:
'
,
'
lifetime:
'
,
'
compression:
'
,
'
strict-mode:
'
,
'
early-refresh:
'
]);
$
handler
=
$
opt
[
'
handler
'
] ??
NULL
;
$
save_path
=
$
opt
[
'
save-path
'
] ??
NULL
;
$
id
=
$
opt
[
'
id
'
] ??
NULL
;
$
sleep
=
$
opt
[
'
sleep
'
] ??
0
;
$
max_execution_time
=
$
opt
[
'
max-execution-time
'
] ??
0
;
$
lock_retries
=
$
opt
[
'
lock-retries
'
] ??
0
;
$
lock_expire
=
$
opt
[
'
lock-expires
'
] ??
0
;
$
data
=
$
opt
[
'
data
'
] ??
NULL
;
$
lifetime
=
$
opt
[
'
lifetime
'
] ??
0
;
$
locking_enabled
=
$
opt
[
'
locking-enabled
'
] ??
NULL
;
$
lock_wait_time
=
$
opt
[
'
lock-wait-time
'
] ??
0
;
$
compression
=
$
opt
[
'
compression
'
] ??
NULL
;
$
strict_mode
= !!(
$
opt
[
'
strict-mode
'
] ??
false
);
$
early_refresh
= !!(
$
opt
[
'
early-refresh
'
] ??
false
);
if
( !
$
handler
) {
fprintf
(
STDERR
,
"
--handler is required
\n"
);
exit
(
1
);
}
else
if
( !
$
save_path
) {
fprintf
(
STDERR
,
"
--save-path is required
\n"
);
exit
(
1
);
}
ini_set
(
'
session.save_handler
'
,
$
handler
);
ini_set
(
'
session.save_path
'
,
$
save_path
);
ini_set
(
'
max_execution_time
'
,
$
max_execution_time
);
ini_set
(
"{
$
handler
}
.session.lock_retries
"
,
$
lock_retries
);
ini_set
(
"{
$
handler
}
.session.lock_expire
"
,
$
lock_expire
);
ini_set
(
'
session.gc_maxlifetime
'
,
$
lifetime
);
ini_set
(
"{
$
handler
}
.session.locking_enabled
"
,
$
locking_enabled
);
ini_set
(
"{
$
handler
}
.session.lock_wait_time
"
,
$
lock_wait_time
);
ini_set
(
'
redis.session.compression
'
,
$
compression
);
ini_set
(
'
session.use_strict_mode
'
,
$
strict_mode
);
ini_set
(
'
redis.session.early_refresh
'
,
$
early_refresh
);
session_id
(
$
id
);
$
status
=
session_start
();
usleep
((
int
)
round
(
$
sleep
*
1000000
));
if
(
$
data
) {
$
_SESSION
[
'
redis_test
'
] =
$
data
;
}
session_write_close
();
echo
$
status
?
'
SUCCESS
'
:
'
FAILURE
'
;
Back
|
FazBrowse Home
|
New Git URL