Neos\Flow\Core\LockManager::__construct PHP 메소드

__construct() 공개 메소드

Initializes the manager, removing expired locks
public __construct ( )
    public function __construct()
    {
        $lockPath = $this->getLockPath();
        $this->lockPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_Flow.lock';
        $this->lockFlagPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_FlowIsLocked';
        $this->removeExpiredLock();
    }

Usage Example

 /**
  * @test
  */
 public function constructorRemovesExpiredLockFiles()
 {
     $this->mockLockFlagFile->lastModified(time() - (LockManager::LOCKFILE_MAXIMUM_AGE + 1));
     $this->assertFileExists($this->mockLockFile->url());
     $this->assertFileExists($this->mockLockFlagFile->url());
     $this->lockManager->__construct();
     $this->assertFileNotExists($this->mockLockFile->url());
     $this->assertFileNotExists($this->mockLockFlagFile->url());
 }