/** * @param string $subject * @param boolean $exclusiveLock TRUE to, acquire an exclusive (write) lock, FALSE for a shared (read) lock. An exclusive lock ist the default. */ public function __construct($subject, $exclusiveLock = true) { if (self::$lockManager === null) { return; } $this->lockStrategy = self::$lockManager->getLockStrategyInstance(); $this->lockStrategy->acquire($subject, $exclusiveLock); }
/** * @param string $subject * @param boolean $exclusiveLock TRUE to, acquire an exclusive (write) lock, FALSE for a shared (read) lock. An exclusive lock ist the default. */ public function __construct($subject, $exclusiveLock = true) { if (self::$lockStrategyClassName === null) { if (Bootstrap::$staticObjectManager === null || !Bootstrap::$staticObjectManager->isRegistered(\TYPO3\Flow\Configuration\ConfigurationManager::class)) { return; } $configurationManager = Bootstrap::$staticObjectManager->get(\TYPO3\Flow\Configuration\ConfigurationManager::class); $settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Flow'); self::$lockStrategyClassName = $settings['utility']['lockStrategyClassName']; } $this->lockStrategy = new self::$lockStrategyClassName(); $this->lockStrategy->acquire($subject, $exclusiveLock); }