ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References $lockFileStorage.

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

Member Function Documentation

◆ getLockFilePath()

ilAssQuestionProcessLockerFile::getLockFilePath (   $processName)
private

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

References $path.

Referenced by requestLock().

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

◆ releaseLock()

ilAssQuestionProcessLockerFile::releaseLock (   $processName)
private

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

Referenced by releasePersistWorkingStateLock().

59  {
60  flock($this->lockFileHandles[$processName], LOCK_UN);
61  fclose($this->lockFileHandles[$processName]);
62  }
+ Here is the caller graph for this function:

◆ releasePersistWorkingStateLock()

ilAssQuestionProcessLockerFile::releasePersistWorkingStateLock ( )

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

References releaseLock().

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

◆ requestLock()

ilAssQuestionProcessLockerFile::requestLock (   $processName)
private

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

References getLockFilePath().

Referenced by requestPersistWorkingStateLock().

46  {
47  $lockFilePath = $this->getLockFilePath($processName);
48  $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
49  flock($this->lockFileHandles[$processName], LOCK_EX);
50  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requestPersistWorkingStateLock()

ilAssQuestionProcessLockerFile::requestPersistWorkingStateLock ( )

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

References requestLock().

36  {
37  $this->requestLock(self::PROCESS_NAME_PERSIST_WORKING_STATE);
38  }
+ 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: