You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.6 KiB
57 lines
1.6 KiB
12 years ago
|
<?php
|
||
12 years ago
|
/**
|
||
|
* @link http://www.yiiframework.com/
|
||
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
||
|
* @license http://www.yiiframework.com/license/
|
||
|
*/
|
||
12 years ago
|
|
||
|
namespace yii\mutex\db\mssql;
|
||
|
|
||
|
use Yii;
|
||
|
use yii\base\InvalidConfigException;
|
||
|
|
||
12 years ago
|
/**
|
||
|
* @author resurtm <resurtm@gmail.com>
|
||
|
* @since 2.0
|
||
|
*/
|
||
12 years ago
|
class Mutex extends \yii\mutex\db\Mutex
|
||
|
{
|
||
12 years ago
|
/**
|
||
|
* Initializes Microsoft SQL Server specific mutex component implementation.
|
||
|
* @throws InvalidConfigException if [[db]] is not Microsoft SQL Server connection.
|
||
|
*/
|
||
12 years ago
|
public function init()
|
||
|
{
|
||
|
parent::init();
|
||
|
$driverName = $this->db->driverName;
|
||
|
if ($driverName !== 'sqlsrv' && $driverName !== 'dblib' && $driverName !== 'mssql') {
|
||
|
throw new InvalidConfigException('');
|
||
|
}
|
||
|
}
|
||
|
|
||
12 years ago
|
/**
|
||
|
* This method should be extended by concrete mutex implementations. Acquires lock by given name.
|
||
|
* @param string $name of the lock to be acquired.
|
||
|
* @param integer $timeout to wait for lock to become released.
|
||
|
* @return boolean acquiring result.
|
||
|
* @throws \BadMethodCallException
|
||
|
* @see http://msdn.microsoft.com/en-us/library/ms189823.aspx
|
||
|
*/
|
||
12 years ago
|
protected function acquire($name, $timeout = 0)
|
||
|
{
|
||
12 years ago
|
throw new \BadMethodCallException('Not implemented yet.');
|
||
12 years ago
|
}
|
||
|
|
||
12 years ago
|
/**
|
||
|
* This method should be extended by concrete mutex implementations. Releases lock by given name.
|
||
|
* @param string $name of the lock to be released.
|
||
|
* @return boolean release result.
|
||
|
* @throws \BadMethodCallException
|
||
|
* @see http://msdn.microsoft.com/en-us/library/ms178602.aspx
|
||
|
*/
|
||
12 years ago
|
protected function release($name)
|
||
|
{
|
||
12 years ago
|
throw new \BadMethodCallException('Not implemented yet.');
|
||
12 years ago
|
}
|
||
|
}
|