mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 13:58:24 +08:00
pull origin
This commit is contained in:
@@ -29,6 +29,7 @@ abstract class DbMutex extends Mutex
|
||||
*/
|
||||
public $db = 'db';
|
||||
|
||||
|
||||
/**
|
||||
* Initializes generic database table based mutex implementation.
|
||||
* @throws InvalidConfigException if [[db]] is invalid.
|
||||
|
||||
@@ -58,11 +58,13 @@ class FileMutex extends Mutex
|
||||
* but read-only for other users.
|
||||
*/
|
||||
public $dirMode = 0775;
|
||||
|
||||
/**
|
||||
* @var resource[] stores all opened lock files. Keys are lock names and values are file handles.
|
||||
*/
|
||||
private $_files = [];
|
||||
|
||||
|
||||
/**
|
||||
* Initializes mutex component implementation dedicated for UNIX, GNU/Linux, Mac OS X, and other UNIX-like
|
||||
* operating systems.
|
||||
@@ -70,7 +72,7 @@ class FileMutex extends Mutex
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if (stripos(php_uname('s'), 'win') === 0) {
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
throw new InvalidConfigException('FileMutex does not have MS Windows operating system support.');
|
||||
}
|
||||
$this->mutexPath = Yii::getAlias($this->mutexPath);
|
||||
|
||||
@@ -38,11 +38,13 @@ abstract class Mutex extends Component
|
||||
* acquire in this process must be released in any case (regardless any kind of errors or exceptions).
|
||||
*/
|
||||
public $autoRelease = true;
|
||||
|
||||
/**
|
||||
* @var string[] names of the locks acquired in the current PHP process.
|
||||
*/
|
||||
private $_locks = [];
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the mutex component.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user