mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
If default path is not writable, fallback to tmp dir.
This commit is contained in:
parent
8aaaacc23c
commit
ccc8dd061c
@ -67,10 +67,16 @@ class TestSessionEnvironment extends Object {
|
||||
*/
|
||||
public function getFilePath() {
|
||||
if($this->id) {
|
||||
return Director::getAbsFile(sprintf($this->config()->test_state_id_file, $this->id));
|
||||
$path = Director::getAbsFile(sprintf($this->config()->test_state_id_file, $this->id));
|
||||
} else {
|
||||
return Director::getAbsFile($this->config()->test_state_file);
|
||||
$path = Director::getAbsFile($this->config()->test_state_file);
|
||||
}
|
||||
|
||||
if(!is_writable(dirname($path))) {
|
||||
$path = str_replace(Director::baseFolder(), TEMP_FOLDER, $path);
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user