ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 {
Parameters
bool$withTaxonomyTables
} More...
 
 onAfterExecutingRandomPassBuildOperation ($withTaxonomyTables=false)
 {
Parameters
bool$withTaxonomyTables
} 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.

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

References $lockFileStorage.

Member Function Documentation

◆ getLockFilePath()

ilTestProcessLockerFile::getLockFilePath (   $processName)
private

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

100 {
101 $path = $this->lockFileStorage->getPath();
102 return $path . '/' . $processName . '.lock';
103 }

References $path.

Referenced by requestLock().

+ Here is the caller graph for this function:

◆ onAfterExecutingRandomPassBuildOperation()

ilTestProcessLockerFile::onAfterExecutingRandomPassBuildOperation (   $withTaxonomyTables = false)
protected

{

Parameters
bool$withTaxonomyTables
}

Reimplemented from ilTestProcessLocker.

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

69 {
70 $this->releaseLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
71 parent::onAfterExecutingRandomPassBuildOperation($withTaxonomyTables);
72 }

References releaseLock().

+ Here is the call graph for this function:

◆ onAfterExecutingTestFinishOperation()

ilTestProcessLockerFile::onAfterExecutingTestFinishOperation ( )
protected

{}

Reimplemented from ilTestProcessLocker.

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

87 {
88 $this->releaseLock(self::PROCESS_NAME_TEST_FINISH);
89 parent::onAfterExecutingTestStartOperation();
90 }

References releaseLock().

+ Here is the call graph for this function:

◆ onAfterExecutingTestStartOperation()

ilTestProcessLockerFile::onAfterExecutingTestStartOperation ( )
protected

{}

Reimplemented from ilTestProcessLocker.

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

51 {
52 $this->releaseLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
53 parent::onAfterExecutingTestStartOperation();
54 }

References releaseLock().

+ Here is the call graph for this function:

◆ onBeforeExecutingRandomPassBuildOperation()

ilTestProcessLockerFile::onBeforeExecutingRandomPassBuildOperation (   $withTaxonomyTables = false)
protected

{

Parameters
bool$withTaxonomyTables
}

Reimplemented from ilTestProcessLocker.

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

60 {
61 parent::onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables);
62 $this->requestLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
63 }

References requestLock().

+ Here is the call graph for this function:

◆ onBeforeExecutingTestFinishOperation()

ilTestProcessLockerFile::onBeforeExecutingTestFinishOperation ( )
protected

{}

Reimplemented from ilTestProcessLocker.

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

78 {
79 parent::onBeforeExecutingTestStartOperation();
80 $this->requestLock(self::PROCESS_NAME_TEST_FINISH);
81 }

References requestLock().

+ Here is the call graph for this function:

◆ onBeforeExecutingTestStartOperation()

ilTestProcessLockerFile::onBeforeExecutingTestStartOperation ( )
protected

{}

Reimplemented from ilTestProcessLocker.

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

42 {
43 parent::onBeforeExecutingTestStartOperation();
44 $this->requestLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
45 }

References requestLock().

+ Here is the call graph for this function:

◆ releaseLock()

ilTestProcessLockerFile::releaseLock (   $processName)
private

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

106 {
107 flock($this->lockFileHandles[$processName], LOCK_UN);
108 fclose($this->lockFileHandles[$processName]);
109 }

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

+ Here is the caller graph for this function:

◆ requestLock()

ilTestProcessLockerFile::requestLock (   $processName)
private

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

93 {
94 $lockFilePath = $this->getLockFilePath($processName);
95 $this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
96 flock($this->lockFileHandles[$processName], LOCK_EX);
97 }

References getLockFilePath().

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

+ 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: