ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssQuestionProcessLockerFile Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockerFile:
+ Collaboration diagram for ilAssQuestionProcessLockerFile:

Public Member Functions

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

Data Fields

const PROCESS_NAME_QUESTION_WORKING_STATE_UPDATE = 'questionWorkingStateUpdate'
 

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 62 of file class.ilAssQuestionProcessLockerFile.php.

References $path.

Referenced by requestLock().

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

◆ releaseLock()

ilAssQuestionProcessLockerFile::releaseLock (   $processName)
private

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

Referenced by releasePersistWorkingStateLock(), and releaseUserSolutionAdoptLock().

69  {
70  flock($this->lockFileHandles[$processName], LOCK_UN);
71  fclose($this->lockFileHandles[$processName]);
72  }
+ 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_QUESTION_WORKING_STATE_UPDATE);
43  }
+ Here is the call graph for this function:

◆ releaseUserSolutionAdoptLock()

ilAssQuestionProcessLockerFile::releaseUserSolutionAdoptLock ( )

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

References releaseLock().

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

◆ requestLock()

ilAssQuestionProcessLockerFile::requestLock (   $processName)
private

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

References getLockFilePath().

Referenced by requestPersistWorkingStateLock(), and requestUserSolutionAdoptLock().

56  {
57  $lockFilePath = $this->getLockFilePath($processName);
58  $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
59  flock($this->lockFileHandles[$processName], LOCK_EX);
60  }
+ 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_QUESTION_WORKING_STATE_UPDATE);
38  }
+ Here is the call graph for this function:

◆ requestUserSolutionAdoptLock()

ilAssQuestionProcessLockerFile::requestUserSolutionAdoptLock ( )

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

References requestLock().

46  {
47  $this->requestLock(self::PROCESS_NAME_QUESTION_WORKING_STATE_UPDATE);
48  }
+ 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_QUESTION_WORKING_STATE_UPDATE

const ilAssQuestionProcessLockerFile::PROCESS_NAME_QUESTION_WORKING_STATE_UPDATE = 'questionWorkingStateUpdate'

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


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