ILIAS
release_5-1 Revision 5.0.0-5477-g43f3e3fab5
◀ 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
if
(!file_exists($this->
getPath
()))
58
{
59
ilUtil::makeDirParents
($this->
getPath
());
60
}
61
return
true
;
62
}
63
64
private
function
initSubPath
($userId)
65
{
66
$userId = (string)$userId;
67
68
$path
= array();
69
70
for
($i = 0, $max = strlen($userId); $i < $max; $i++)
71
{
72
$path
[] = substr($userId, $i, 1);
73
}
74
75
$this->subPath = implode(
'/'
,
$path
);
76
77
}
78
}
ilUtil\makeDirParents
static makeDirParents($a_dir)
Create a new directory and all parent directories.
Definition:
class.ilUtil.php:2482
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
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:64
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
Modules
TestQuestionPool
classes
class.ilAssQuestionProcessLockFileStorage.php
Generated on Wed Mar 27 2024 19:01:02 for ILIAS by
1.8.13 (using
Doxyfile
)