19 declare(strict_types=1);
47 $this->lockFileHandles = [];
55 parent::onBeforeExecutingTestStartOperation();
56 $this->
requestLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
64 $this->
releaseLock(self::PROCESS_NAME_TEST_START_LOCK_CHECK);
65 parent::onAfterExecutingTestStartOperation();
73 parent::onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables);
74 $this->
requestLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
82 $this->
releaseLock(self::PROCESS_NAME_RANDOM_PASS_BUILD);
83 parent::onAfterExecutingRandomPassBuildOperation($withTaxonomyTables);
91 parent::onBeforeExecutingTestStartOperation();
100 $this->
releaseLock(self::PROCESS_NAME_TEST_FINISH);
101 parent::onAfterExecutingTestStartOperation();
107 parent::onBeforeExecutingNamedOperation($operationDescriptor);
113 parent::onAfterExecutingNamedOperation($operationDescriptor);
119 $this->lockFileHandles[$processName] = fopen($lockFilePath,
'w');
120 flock($this->lockFileHandles[$processName], LOCK_EX);
125 $path = $this->lockFileStorage->getAbsolutePath();
126 return $path .
'/' . $processName .
'.lock';
131 flock($this->lockFileHandles[$processName], LOCK_UN);
132 fclose($this->lockFileHandles[$processName]);
onAfterExecutingTestFinishOperation()
{}
releaseLock($processName)
ilTestProcessLockFileStorage $lockFileStorage
onAfterExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
onBeforeExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingTestStartOperation()
{}
onAfterExecutingNamedOperation(string $operationDescriptor)
onBeforeExecutingTestFinishOperation()
{}
const PROCESS_NAME_RANDOM_PASS_BUILD
const PROCESS_NAME_TEST_FINISH
__construct(ilTestProcessLockFileStorage $lockFileStorage)
ilTestProcessLockerFile constructor.
getLockFilePath($processName)
onAfterExecutingTestStartOperation()
{}
requestLock($processName)
onBeforeExecutingRandomPassBuildOperation($withTaxonomyTables=false)
{}
const PROCESS_NAME_TEST_START_LOCK_CHECK