ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestProcessLockerFile Class Reference
+ Inheritance diagram for ilTestProcessLockerFile:
+ Collaboration diagram for ilTestProcessLockerFile:

Public Member Functions

 __construct (ilTestProcessLockFileStorage $lockFileStorage)
 
 requestTestStartLockCheckLock ()
 
 releaseTestStartLockCheckLock ()
 
 requestRandomPassBuildLock ()
 
 releaseRandomPassBuildLock ()
 
- Public Member Functions inherited from ilTestProcessLocker
 requestTestStartLockCheckLock ()
 
 releaseTestStartLockCheckLock ()
 
 requestRandomPassBuildLock ()
 
 releaseRandomPassBuildLock ()
 

Data Fields

const PROCESS_NAME_TEST_START_LOCK_CHECK = 'testStartLockCheck'
 
const PROCESS_NAME_RANDOM_PASS_BUILD = 'randomPassBuild'
 

Protected Attributes

 $lockFileStorage
 
 $lockFileHandles
 

Private Member Functions

 requestLock ($processName)
 
 getLockFilePath ($processName)
 
 releaseLock ($processName)
 

Detailed Description

Definition at line 12 of file class.ilTestProcessLockerFile.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestProcessLockerFile::__construct ( ilTestProcessLockFileStorage  $lockFileStorage)
Parameters
ilAssQuestionProcessLockFileStorage$lockFileStorage

Definition at line 30 of file class.ilTestProcessLockerFile.php.

References $lockFileStorage.

31  {
32  $this->lockFileStorage = $lockFileStorage;
33  $this->lockFileHandles = array();
34  }

Member Function Documentation

◆ getLockFilePath()

ilTestProcessLockerFile::getLockFilePath (   $processName)
private

Definition at line 63 of file class.ilTestProcessLockerFile.php.

References $path.

Referenced by requestLock().

64  {
65  $path = $this->lockFileStorage->getPath();
66  return $path.'/'.$processName.'.lock';
67  }
$path
Definition: index.php:22
+ Here is the caller graph for this function:

◆ releaseLock()

ilTestProcessLockerFile::releaseLock (   $processName)
private

Definition at line 69 of file class.ilTestProcessLockerFile.php.

Referenced by releaseRandomPassBuildLock(), and releaseTestStartLockCheckLock().

70  {
71  flock($this->lockFileHandles[$processName], LOCK_UN);
72  fclose($this->lockFileHandles[$processName]);
73  }
+ Here is the caller graph for this function:

◆ releaseRandomPassBuildLock()

ilTestProcessLockerFile::releaseRandomPassBuildLock ( )

Definition at line 51 of file class.ilTestProcessLockerFile.php.

References releaseLock().

52  {
53  $this->releaseLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
54  }
+ Here is the call graph for this function:

◆ releaseTestStartLockCheckLock()

ilTestProcessLockerFile::releaseTestStartLockCheckLock ( )

Definition at line 41 of file class.ilTestProcessLockerFile.php.

References releaseLock().

42  {
43  $this->releaseLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
44  }
+ Here is the call graph for this function:

◆ requestLock()

ilTestProcessLockerFile::requestLock (   $processName)
private

Definition at line 56 of file class.ilTestProcessLockerFile.php.

References getLockFilePath().

Referenced by requestRandomPassBuildLock(), and requestTestStartLockCheckLock().

57  {
58  $lockFilePath = $this->getLockFilePath($processName);
59  $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
60  flock($this->lockFileHandles[$processName], LOCK_EX);
61  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requestRandomPassBuildLock()

ilTestProcessLockerFile::requestRandomPassBuildLock ( )

Definition at line 46 of file class.ilTestProcessLockerFile.php.

References requestLock().

47  {
48  $this->requestLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
49  }
+ Here is the call graph for this function:

◆ requestTestStartLockCheckLock()

ilTestProcessLockerFile::requestTestStartLockCheckLock ( )

Definition at line 36 of file class.ilTestProcessLockerFile.php.

References requestLock().

37  {
38  $this->requestLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
39  }
+ Here is the call graph for this function:

Field Documentation

◆ $lockFileHandles

ilTestProcessLockerFile::$lockFileHandles
protected

Definition at line 25 of file class.ilTestProcessLockerFile.php.

◆ $lockFileStorage

ilTestProcessLockerFile::$lockFileStorage
protected

Definition at line 20 of file class.ilTestProcessLockerFile.php.

Referenced by __construct().

◆ PROCESS_NAME_RANDOM_PASS_BUILD

const ilTestProcessLockerFile::PROCESS_NAME_RANDOM_PASS_BUILD = 'randomPassBuild'

Definition at line 15 of file class.ilTestProcessLockerFile.php.

◆ PROCESS_NAME_TEST_START_LOCK_CHECK

const ilTestProcessLockerFile::PROCESS_NAME_TEST_START_LOCK_CHECK = 'testStartLockCheck'

Definition at line 14 of file class.ilTestProcessLockerFile.php.


The documentation for this class was generated from the following file: