0 follower

Final Class Yiisoft\Mutex\File\FileMutexFactory

InheritanceYiisoft\Mutex\File\FileMutexFactory » Yiisoft\Mutex\MutexFactory

Allows creating file mutex objects.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $mutexPath, integer $directoryMode 0775, integer|null $fileMode null )
$mutexPath string

The directory to store mutex files.

$directoryMode integer

The permission to be set for newly created directories. This value will be used by PHP {@see \Yiisoft\Mutex\File\chmod()} function. No umask will be applied. Defaults to 0775, meaning the directory is read-writable by owner and group, but read-only for other users.

$fileMode integer|null

The permission to be set for newly created mutex files. This value will be used by PHP {@see \Yiisoft\Mutex\File\chmod()} function. No umask will be applied.

                public function __construct(string $mutexPath, int $directoryMode = 0775, ?int $fileMode = null)
{
    $this->mutexPath = $mutexPath;
    $this->directoryMode = $directoryMode;
    $this->fileMode = $fileMode;
}

            
create() public method

public \Yiisoft\Mutex\MutexInterface create ( string $name )
$name string

                public function create(string $name): MutexInterface
{
    return new FileMutex($name, $this->mutexPath, $this->directoryMode, $this->fileMode);
}