mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
cleanup session temp file (#2641)
* cleanup session temp file * Fix Deprecated: Automatic conversion of false to array
This commit is contained in:
@@ -6185,6 +6185,7 @@ class Redis_Test extends TestSuite {
|
||||
// Use a unique ID so we can find our type keys
|
||||
$id = uniqid();
|
||||
|
||||
$keys = [];
|
||||
// Create some simple keys and lists
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$simple = "simple:{$id}:$i";
|
||||
|
||||
@@ -80,7 +80,7 @@ class Runner {
|
||||
];
|
||||
|
||||
private $prefix = NULL;
|
||||
private $output_file;
|
||||
private $output_file = NULL;
|
||||
private $exit_code = -1;
|
||||
private $cmd = NULL;
|
||||
private $pid;
|
||||
@@ -90,6 +90,12 @@ class Runner {
|
||||
$this->args['id'] = $this->createId();
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if ($this->output_file) {
|
||||
unlink($this->output_file);
|
||||
}
|
||||
}
|
||||
|
||||
public function getExitCode(): int {
|
||||
return $this->exit_code;
|
||||
}
|
||||
@@ -183,7 +189,6 @@ class Runner {
|
||||
}
|
||||
|
||||
private function getTmpFileName() {
|
||||
return '/tmp/sessiontmp.txt';
|
||||
return tempnam(sys_get_temp_dir(), 'session');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user