ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilAssQuestionProcessLockerFile Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockerFile:
+ Collaboration diagram for ilAssQuestionProcessLockerFile:

Public Member Functions

 __construct (ilAssQuestionProcessLockFileStorage $lockFileStorage)
 
 requestPersistWorkingStateLock ()
 
 releasePersistWorkingStateLock ()
 
- Public Member Functions inherited from ilAssQuestionProcessLocker
 requestPersistWorkingStateLock ()
 
 releasePersistWorkingStateLock ()
 
 requestUserSolutionUpdateLock ()
 
 releaseUserSolutionUpdateLock ()
 
 requestUserQuestionResultUpdateLock ()
 
 releaseUserQuestionResultUpdateLock ()
 
 requestUserPassResultUpdateLock ()
 
 releaseUserPassResultUpdateLock ()
 
 requestUserTestResultUpdateLock ()
 
 releaseUserTestResultUpdateLock ()
 

Data Fields

const PROCESS_NAME_PERSIST_WORKING_STATE = 'persistWorkingState'
 

Protected Attributes

 $lockFileStorage
 
 $lockFileHandles
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockerFile::__construct ( ilAssQuestionProcessLockFileStorage  $lockFileStorage)
Parameters
ilAssQuestionProcessLockFileStorage$lockFileStorage

Definition at line 29 of file class.ilAssQuestionProcessLockerFile.php.

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

References $lockFileStorage.

Member Function Documentation

◆ getLockFilePath()

ilAssQuestionProcessLockerFile::getLockFilePath (   $processName)
private

Definition at line 52 of file class.ilAssQuestionProcessLockerFile.php.

53 {
54 $path = $this->lockFileStorage->getPath();
55 return $path.'/'.$processName.'.lock';
56 }
$path
Definition: index.php:22

References $path.

Referenced by requestLock().

+ Here is the caller graph for this function:

◆ releaseLock()

ilAssQuestionProcessLockerFile::releaseLock (   $processName)
private

Definition at line 58 of file class.ilAssQuestionProcessLockerFile.php.

59 {
60 flock($this->lockFileHandles[$processName], LOCK_UN);
61 fclose($this->lockFileHandles[$processName]);
62 }

Referenced by releasePersistWorkingStateLock().

+ Here is the caller graph for this function:

◆ releasePersistWorkingStateLock()

ilAssQuestionProcessLockerFile::releasePersistWorkingStateLock ( )

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 40 of file class.ilAssQuestionProcessLockerFile.php.

41 {
42 $this->releaseLock(self::PROCESS_NAME_PERSIST_WORKING_STATE);
43 }

References releaseLock().

+ Here is the call graph for this function:

◆ requestLock()

ilAssQuestionProcessLockerFile::requestLock (   $processName)
private

Definition at line 45 of file class.ilAssQuestionProcessLockerFile.php.

46 {
47 $lockFilePath = $this->getLockFilePath($processName);
48 $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
49 flock($this->lockFileHandles[$processName], LOCK_EX);
50 }

References getLockFilePath().

Referenced by requestPersistWorkingStateLock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requestPersistWorkingStateLock()

ilAssQuestionProcessLockerFile::requestPersistWorkingStateLock ( )

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 35 of file class.ilAssQuestionProcessLockerFile.php.

36 {
37 $this->requestLock(self::PROCESS_NAME_PERSIST_WORKING_STATE);
38 }

References requestLock().

+ Here is the call graph for this function:

Field Documentation

◆ $lockFileHandles

ilAssQuestionProcessLockerFile::$lockFileHandles
protected

Definition at line 24 of file class.ilAssQuestionProcessLockerFile.php.

◆ $lockFileStorage

ilAssQuestionProcessLockerFile::$lockFileStorage
protected

Definition at line 19 of file class.ilAssQuestionProcessLockerFile.php.

Referenced by __construct().

◆ PROCESS_NAME_PERSIST_WORKING_STATE

const ilAssQuestionProcessLockerFile::PROCESS_NAME_PERSIST_WORKING_STATE = 'persistWorkingState'

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


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