ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilTestProcessLockerFactory.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
'Modules/Test/classes/class.ilObjAssessmentFolder.php'
;
5
require_once
'Modules/Test/classes/class.ilTestProcessLocker.php'
;
6
require_once
'Modules/Test/classes/class.ilTestProcessLockerNone.php'
;
7
require_once
'Modules/Test/classes/class.ilTestProcessLockerFile.php'
;
8
require_once
'Modules/Test/classes/class.ilTestProcessLockerDb.php'
;
9
16
class
ilTestProcessLockerFactory
17
{
21
protected
$settings
;
22
26
protected
$db
;
27
31
protected
$activeId
;
32
37
public
function
__construct
(
ilSetting
$settings
,
ilDBInterface
$db
)
38
{
39
$this->
settings
=
$settings
;
40
$this->db =
$db
;
41
42
$this->activeId = null;
43
}
44
48
public
function
setActiveId
(
$activeId
)
49
{
50
$this->activeId =
$activeId
;
51
}
52
56
public
function
getActiveId
()
57
{
58
return
$this->activeId
;
59
}
60
61
private
function
getLockModeSettingValue
()
62
{
63
return
$this->
settings
->get(
'ass_process_lock_mode'
,
ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE
);
64
}
65
69
public
function
getLocker
()
70
{
71
switch
( $this->
getLockModeSettingValue
() )
72
{
73
case
ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE
:
74
75
$locker =
new
ilTestProcessLockerNone
();
76
break
;
77
78
case
ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE
:
79
80
require_once
'Modules/Test/classes/class.ilTestProcessLockFileStorage.php'
;
81
$storage =
new
ilTestProcessLockFileStorage
($this->
getActiveId
());
82
$storage->create();
83
84
$locker =
new
ilTestProcessLockerFile
($storage);
85
break
;
86
87
case
ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB
:
88
89
$locker =
new
ilTestProcessLockerDb
($this->db);
90
break
;
91
}
92
93
return
$locker;
94
}
95
}
ilTestProcessLockerFactory\__construct
__construct(ilSetting $settings, ilDBInterface $db)
Definition:
class.ilTestProcessLockerFactory.php:37
ilSetting
ILIAS Setting Class.
Definition:
class.ilSetting.php:32
ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_DB
const ASS_PROC_LOCK_MODE_DB
Definition:
class.ilObjAssessmentFolder.php:24
ilTestProcessLockerFactory\$settings
$settings
Definition:
class.ilTestProcessLockerFactory.php:21
ilTestProcessLockerNone
Definition:
class.ilTestProcessLockerNone.php:12
ilTestProcessLockerFactory\$db
$db
Definition:
class.ilTestProcessLockerFactory.php:26
ilTestProcessLockerFactory\setActiveId
setActiveId($activeId)
Definition:
class.ilTestProcessLockerFactory.php:48
ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE
const ASS_PROC_LOCK_MODE_NONE
Definition:
class.ilObjAssessmentFolder.php:22
ilDBInterface
Interface ilDBInterface.
Definition:
interface.ilDBInterface.php:9
ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_FILE
const ASS_PROC_LOCK_MODE_FILE
Definition:
class.ilObjAssessmentFolder.php:23
ilTestProcessLockerFactory
Definition:
class.ilTestProcessLockerFactory.php:16
ilTestProcessLockerFactory\getLockModeSettingValue
getLockModeSettingValue()
Definition:
class.ilTestProcessLockerFactory.php:61
ilTestProcessLockerFactory\getLocker
getLocker()
Definition:
class.ilTestProcessLockerFactory.php:69
ilTestProcessLockerFactory\getActiveId
getActiveId()
Definition:
class.ilTestProcessLockerFactory.php:56
ilTestProcessLockerFile
Definition:
class.ilTestProcessLockerFile.php:12
ilTestProcessLockFileStorage
Definition:
class.ilTestProcessLockFileStorage.php:12
settings
settings()
Definition:
settings.php:2
ilTestProcessLockerFactory\$activeId
$activeId
Definition:
class.ilTestProcessLockerFactory.php:31
ilTestProcessLockerDb
Definition:
class.ilTestProcessLockerDb.php:12
php
Modules
Test
classes
class.ilTestProcessLockerFactory.php
Generated on Fri Jan 17 2025 19:01:03 for ILIAS by
1.8.13 (using
Doxyfile
)