ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
◀ ilDoc Overview
class.ilAssQuestionProcessLockFileStorage.php
Go to the documentation of this file.
1
<?php
2
25
class
ilAssQuestionProcessLockFileStorage
extends
ilFileSystemAbstractionStorage
26
{
27
private
string
$sub_path
;
28
29
public
function
__construct
(
int
$question_id,
int
$user_id
)
30
{
31
parent::__construct
(
ilFileSystemAbstractionStorage::STORAGE_DATA
,
true
, $question_id);
32
33
$this->
initSubPath
($user_id);
34
}
35
44
protected
function
getPathPrefix
(): string
45
{
46
return
'ilAssQuestionProcessLocks'
;
47
}
48
58
protected
function
getPathPostfix
(): string
59
{
60
return
'question'
;
61
}
62
63
public
function
getAbsolutePath
(): string
64
{
65
return
rtrim($this->
getLegacyAbsolutePath
(),
'/'
) .
'/'
.
$this->sub_path
;
66
}
67
68
69
public
function
getPath
(): string
70
{
71
return
parent::getPath() .
'/'
.
$this->sub_path
;
72
}
73
74
public
function
create
(): void
75
{
76
set_error_handler(
function
($severity, $message, $file, $line):
void
{
77
throw
new
ErrorException($message, $severity, 0, $file, $line);
78
});
79
80
try
{
81
if
(!$this->
getFileSystemService
()->has($this->
getPath
())) {
82
$this->
getFileSystemService
()->createDir($this->
getPath
());
83
}
84
restore_error_handler();
85
}
catch
(Exception
$e
) {
86
restore_error_handler();
87
}
88
89
if
(!$this->
getFileSystemService
()->
has
($this->path)) {
90
throw
new
ErrorException(sprintf(
'Could not find directory: %s'
, $this->
getPath
()));
91
}
92
}
93
94
private
function
initSubPath
(
int
$user_id
): void
95
{
96
$user_id
= (string)
$user_id
;
97
98
$path
= [];
99
100
for
($i = 0, $max = strlen(
$user_id
); $i < $max; $i++) {
101
$path
[] = substr(
$user_id
, $i, 1);
102
}
103
104
$this->sub_path = implode(
'/'
,
$path
);
105
}
106
}
ilAssQuestionProcessLockFileStorage
Definition:
class.ilAssQuestionProcessLockFileStorage.php:26
ilAssQuestionProcessLockFileStorage\getPath
getPath()
Definition:
class.ilAssQuestionProcessLockFileStorage.php:69
ilAssQuestionProcessLockFileStorage\__construct
__construct(int $question_id, int $user_id)
Definition:
class.ilAssQuestionProcessLockFileStorage.php:29
ilAssQuestionProcessLockFileStorage\getPathPostfix
getPathPostfix()
Get directory name.
Definition:
class.ilAssQuestionProcessLockFileStorage.php:58
ilAssQuestionProcessLockFileStorage\getPathPrefix
getPathPrefix()
Get path prefix.
Definition:
class.ilAssQuestionProcessLockFileStorage.php:44
ilAssQuestionProcessLockFileStorage\initSubPath
initSubPath(int $user_id)
Definition:
class.ilAssQuestionProcessLockFileStorage.php:94
ilAssQuestionProcessLockFileStorage\create
create()
Definition:
class.ilAssQuestionProcessLockFileStorage.php:74
ilAssQuestionProcessLockFileStorage\$sub_path
string $sub_path
Definition:
class.ilAssQuestionProcessLockFileStorage.php:27
ilAssQuestionProcessLockFileStorage\getAbsolutePath
getAbsolutePath()
Calculates the full path on the filesystem.
Definition:
class.ilAssQuestionProcessLockFileStorage.php:63
ilFileSystemAbstractionStorage
Definition:
class.ilFileSystemAbstractionStorage.php:28
ilFileSystemAbstractionStorage\getLegacyAbsolutePath
getLegacyAbsolutePath()
Calculates the absolute filesystem storage location.
Definition:
class.ilFileSystemAbstractionStorage.php:178
ilFileSystemAbstractionStorage\$path
string $path
Definition:
class.ilFileSystemAbstractionStorage.php:35
ilFileSystemAbstractionStorage\STORAGE_DATA
const STORAGE_DATA
Definition:
class.ilFileSystemAbstractionStorage.php:30
ilFileSystemAbstractionStorage\getFileSystemService
getFileSystemService()
Definition:
class.ilFileSystemAbstractionStorage.php:69
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:38
ILIAS\GlobalScreen\has
has(string $class_name)
Definition:
SingletonTrait.php:62
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
$user_id
int $user_id
Definition:
trait.ilExAssignmentTypeGUIBase.php:25
components
ILIAS
TestQuestionPool
classes
class.ilAssQuestionProcessLockFileStorage.php
Generated on Sat Dec 13 2025 23:03:50 for ILIAS by
1.9.4 (using
Doxyfile
)