/**
* Simple lock server daemon that accepts lock/unlock requests
+ *
+ * @ingroup LockManager Maintenance
*/
class LockServerDaemon {
/** @var resource */
/**
* @params $config Array
+ * @param array $config
+ * @throws Exception
* @return LockServerDaemon
*/
public static function init( array $config ) {
}
/**
+ * @throws Exception
* @return void
*/
protected function setupServerSocket() {
list( $session, $key, $command, $type, $values ) = $m;
if ( sha1( $session . $command . $type . $values . $this->authKey ) !== $key ) {
return 'BAD_KEY';
- } elseif ( strlen( $session ) !== 31 ) {
+ } elseif ( strlen( $session ) !== 32 ) {
return 'BAD_SESSION';
}
$values = explode( '|', $values );
/**
* Remove a socket's corresponding session from tracking and
* store it in the dead session tracking if it still has locks.
- *
+ *
* @param $socket resource
* @return bool
*/
/**
* Get the current timestamp and memory usage
- *
+ *
* @return string
*/
protected function stat() {
/**
* @param $session string
- * @return bool
+ * @return bool
*/
public function sessionHasLocks( $session ) {
- return isset( $this->sessionIndexSh[$session] )
+ return isset( $this->sessionIndexSh[$session] )
|| isset( $this->sessionIndexEx[$session] );
}