ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
class.ilAssQuestionProcessLockFileStorage.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
require_once
'Services/FileSystem/classes/class.ilFileSystemStorage.php'
;
5
12
class
ilAssQuestionProcessLockFileStorage
extends
ilFileSystemStorage
13
{
14
private
$subPath
;
15
16
public
function
__construct
($questionId, $userId)
17
{
18
parent::__construct
(
ilFileSystemStorage::STORAGE_DATA
,
true
, $questionId);
19
20
$this->
initSubPath
($userId);
21
}
22
31
protected
function
getPathPrefix
()
32
{
33
return
'ilAssQuestionProcessLocks'
;
34
}
35
45
protected
function
getPathPostfix
()
46
{
47
return
'question'
;
48
}
49
50
public
function
getPath
()
51
{
52
return
parent::getPath() .
'/'
.
$this->subPath
;
53
}
54
55
public
function
create
()
56
{
57
set_error_handler(
function
($severity,
$message
, $file, $line) {
58
throw
new
ErrorException(
$message
, $severity, 0, $file, $line);
59
});
60
61
try
{
62
ilUtil::makeDirParents
($this->
getPath
());
63
restore_error_handler();
64
}
catch
(
Exception
$e
) {
65
restore_error_handler();
66
}
67
68
if
(!file_exists($this->
getPath
())) {
69
throw
new
ErrorException(sprintf(
'Could not find directory: %s'
, $this->
getPath
()));
70
}
71
72
return
true
;
73
}
74
75
private
function
initSubPath
($userId)
76
{
77
$userId = (string) $userId;
78
79
$path
= array();
80
81
for
(
$i
= 0, $max = strlen($userId);
$i
< $max;
$i
++) {
82
$path
[] = substr($userId,
$i
, 1);
83
}
84
85
$this->subPath = implode(
'/'
,
$path
);
86
}
87
}
ilUtil\makeDirParents
static makeDirParents($a_dir)
Create a new directory and all parent directories.
Definition:
class.ilUtil.php:2207
ilAssQuestionProcessLockFileStorage
Definition:
class.ilAssQuestionProcessLockFileStorage.php:12
ilAssQuestionProcessLockFileStorage\__construct
__construct($questionId, $userId)
Definition:
class.ilAssQuestionProcessLockFileStorage.php:16
ilAssQuestionProcessLockFileStorage\getPathPrefix
getPathPrefix()
Get path prefix.
Definition:
class.ilAssQuestionProcessLockFileStorage.php:31
Vendor\Package\$e
$e
Definition:
example_cleaned.php:31
ilFileSystemStorage\STORAGE_DATA
const STORAGE_DATA
Definition:
class.ilFileSystemStorage.php:37
ilAssQuestionProcessLockFileStorage\$subPath
$subPath
Definition:
class.ilAssQuestionProcessLockFileStorage.php:14
ilFileSystemStorage\$path
$path
Definition:
class.ilFileSystemStorage.php:48
ilAssQuestionProcessLockFileStorage\create
create()
Definition:
class.ilAssQuestionProcessLockFileStorage.php:55
ilAssQuestionProcessLockFileStorage\initSubPath
initSubPath($userId)
Definition:
class.ilAssQuestionProcessLockFileStorage.php:75
ilAssQuestionProcessLockFileStorage\getPath
getPath()
Definition:
class.ilAssQuestionProcessLockFileStorage.php:50
ilAssQuestionProcessLockFileStorage\getPathPostfix
getPathPostfix()
Get directory name.
Definition:
class.ilAssQuestionProcessLockFileStorage.php:45
ilFileSystemStorage
Definition:
class.ilFileSystemStorage.php:34
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:30
$message
$message
Definition:
xapiexit.php:14
$i
$i
Definition:
metadata.php:24
Exception
Modules
TestQuestionPool
classes
class.ilAssQuestionProcessLockFileStorage.php
Generated on Sun Aug 31 2025 20:01:06 for ILIAS by
1.8.13 (using
Doxyfile
)