ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestProcessLockerFile Class Reference
+ Inheritance diagram for ilTestProcessLockerFile:
+ Collaboration diagram for ilTestProcessLockerFile:

Public Member Functions

 __construct (ilTestProcessLockFileStorage $lockFileStorage)
 ilTestProcessLockerFile constructor. More...
 
- Public Member Functions inherited from ilTestProcessLocker
 executeTestStartLockOperation (callable $operation)
 
 executeRandomPassBuildOperation (callable $operation, $withTaxonomyTables=false)
 
 executeTestFinishOperation (callable $operation)
 

Data Fields

const PROCESS_NAME_TEST_START_LOCK_CHECK = 'testStartLockCheck'
 
const PROCESS_NAME_RANDOM_PASS_BUILD = 'randomPassBuild'
 
const PROCESS_NAME_TEST_FINISH = 'testFinish'
 

Protected Member Functions

 onBeforeExecutingTestStartOperation ()
 {} More...
 
 onAfterExecutingTestStartOperation ()
 {} More...
 
 onBeforeExecutingRandomPassBuildOperation ($withTaxonomyTables=false)
 {} More...
 
 onAfterExecutingRandomPassBuildOperation ($withTaxonomyTables=false)
 {} More...
 
 onBeforeExecutingTestFinishOperation ()
 {} More...
 
 onAfterExecutingTestFinishOperation ()
 {} More...
 
- Protected Member Functions inherited from ilTestProcessLocker
 executeOperation (callable $operation)
 
 onBeforeExecutingTestStartOperation ()
 
 onAfterExecutingTestStartOperation ()
 
 onBeforeExecutingRandomPassBuildOperation ($withTaxonomyTables=false)
 
 onAfterExecutingRandomPassBuildOperation ($withTaxonomyTables=false)
 
 onBeforeExecutingTestFinishOperation ()
 
 onAfterExecutingTestFinishOperation ()
 

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)

ilTestProcessLockerFile constructor.

Parameters
ilTestProcessLockFileStorage$lockFileStorage

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

References $lockFileStorage.

33  {
34  $this->lockFileStorage = $lockFileStorage;
35  $this->lockFileHandles = array();
36  }

Member Function Documentation

◆ getLockFilePath()

ilTestProcessLockerFile::getLockFilePath (   $processName)
private

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

References $path.

Referenced by requestLock().

100  {
101  $path = $this->lockFileStorage->getPath();
102  return $path . '/' . $processName . '.lock';
103  }
$path
Definition: aliased.php:25
+ Here is the caller graph for this function:

◆ onAfterExecutingRandomPassBuildOperation()

ilTestProcessLockerFile::onAfterExecutingRandomPassBuildOperation (   $withTaxonomyTables = false)
protected

{}

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

References releaseLock().

69  {
70  $this->releaseLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
71  parent::onAfterExecutingRandomPassBuildOperation($withTaxonomyTables);
72  }
+ Here is the call graph for this function:

◆ onAfterExecutingTestFinishOperation()

ilTestProcessLockerFile::onAfterExecutingTestFinishOperation ( )
protected

{}

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

References releaseLock().

87  {
88  $this->releaseLock(self::PROCESS_NAME_TEST_FINISH);
89  parent::onAfterExecutingTestStartOperation();
90  }
+ Here is the call graph for this function:

◆ onAfterExecutingTestStartOperation()

ilTestProcessLockerFile::onAfterExecutingTestStartOperation ( )
protected

{}

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

References releaseLock().

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

◆ onBeforeExecutingRandomPassBuildOperation()

ilTestProcessLockerFile::onBeforeExecutingRandomPassBuildOperation (   $withTaxonomyTables = false)
protected

{}

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

References requestLock().

60  {
61  parent::onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables);
62  $this->requestLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
63  }
+ Here is the call graph for this function:

◆ onBeforeExecutingTestFinishOperation()

ilTestProcessLockerFile::onBeforeExecutingTestFinishOperation ( )
protected

{}

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

References requestLock().

78  {
79  parent::onBeforeExecutingTestStartOperation();
80  $this->requestLock(self::PROCESS_NAME_TEST_FINISH);
81  }
+ Here is the call graph for this function:

◆ onBeforeExecutingTestStartOperation()

ilTestProcessLockerFile::onBeforeExecutingTestStartOperation ( )
protected

{}

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

References requestLock().

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

◆ releaseLock()

ilTestProcessLockerFile::releaseLock (   $processName)
private

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

Referenced by onAfterExecutingRandomPassBuildOperation(), onAfterExecutingTestFinishOperation(), and onAfterExecutingTestStartOperation().

106  {
107  flock($this->lockFileHandles[$processName], LOCK_UN);
108  fclose($this->lockFileHandles[$processName]);
109  }
+ Here is the caller graph for this function:

◆ requestLock()

ilTestProcessLockerFile::requestLock (   $processName)
private

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

References getLockFilePath().

Referenced by onBeforeExecutingRandomPassBuildOperation(), onBeforeExecutingTestFinishOperation(), and onBeforeExecutingTestStartOperation().

93  {
94  $lockFilePath = $this->getLockFilePath($processName);
95  $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
96  flock($this->lockFileHandles[$processName], LOCK_EX);
97  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $lockFileHandles

ilTestProcessLockerFile::$lockFileHandles
protected

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

◆ $lockFileStorage

ilTestProcessLockerFile::$lockFileStorage
protected

Definition at line 21 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_FINISH

const ilTestProcessLockerFile::PROCESS_NAME_TEST_FINISH = 'testFinish'

Definition at line 16 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: