PHP 클래스 yii\mutex\FileMutex

This component relies on PHP flock() function. Application configuration example: [ 'components' => [ 'mutex' => [ 'class' => 'yii\mutex\FileMutex' ], ], ] Note: this component can maintain the locks only for the single web server, it probably will not suffice to your in case you are using cloud server solution. Warning: due to flock() function nature this component is unreliable when using a multithreaded server API like ISAPI.
또한 보기: Mutex
부터: 2.0
저자: resurtm ([email protected])
상속: extends Mutex
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dirMode the permission to be set for newly created directories. This value will be used by PHP 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 the permission to be set for newly created mutex files. This value will be used by PHP chmod() function. No umask will be applied. If not set, the permission will be determined by the current environment.
$mutexPath the directory to store mutex files. You may use path alias here. Defaults to the "mutex" subdirectory under the application runtime path.

공개 메소드들

메소드 설명
init ( ) Initializes mutex component implementation dedicated for UNIX, GNU/Linux, Mac OS X, and other UNIX-like operating systems.

보호된 메소드들

메소드 설명
acquireLock ( string $name, integer $timeout ) : boolean Acquires lock by given name.
getLockFilePath ( string $name ) : string Generate path for lock file.
releaseLock ( string $name ) : boolean Releases lock by given name.

메소드 상세

acquireLock() 보호된 메소드

Acquires lock by given name.
protected acquireLock ( string $name, integer $timeout ) : boolean
$name string of the lock to be acquired.
$timeout integer to wait for lock to become released.
리턴 boolean acquiring result.

getLockFilePath() 보호된 메소드

Generate path for lock file.
부터: 2.0.10
protected getLockFilePath ( string $name ) : string
$name string
리턴 string

init() 공개 메소드

Initializes mutex component implementation dedicated for UNIX, GNU/Linux, Mac OS X, and other UNIX-like operating systems.
public init ( )

releaseLock() 보호된 메소드

Releases lock by given name.
protected releaseLock ( string $name ) : boolean
$name string of the lock to be released.
리턴 boolean release result.

프로퍼티 상세

$dirMode 공개적으로 프로퍼티

the permission to be set for newly created directories. This value will be used by PHP 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.
public $dirMode

$fileMode 공개적으로 프로퍼티

the permission to be set for newly created mutex files. This value will be used by PHP chmod() function. No umask will be applied. If not set, the permission will be determined by the current environment.
public $fileMode

$mutexPath 공개적으로 프로퍼티

the directory to store mutex files. You may use path alias here. Defaults to the "mutex" subdirectory under the application runtime path.
public $mutexPath