mirror of
https://github.com/friendica/friendica
synced 2025-04-25 17:50:11 +00:00
Fixings
- fixed test for semaphore - fixed some issues - changed namespace in Tests back to "src/" - changed namings
This commit is contained in:
parent
906bb25972
commit
e41e7d2edd
15 changed files with 67 additions and 65 deletions
|
@ -20,7 +20,7 @@ class SemaphoreLockDriver extends AbstractLockDriver
|
|||
{
|
||||
$temp = get_temppath();
|
||||
|
||||
$file = $temp.'/'.$key.'.sem';
|
||||
$file = $temp . '/' . $key . '.sem';
|
||||
|
||||
if (!file_exists($file)) {
|
||||
file_put_contents($file, $key);
|
||||
|
@ -33,7 +33,7 @@ class SemaphoreLockDriver extends AbstractLockDriver
|
|||
*
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function acquire($key, $timeout = 120)
|
||||
public function acquireLock($key, $timeout = 120)
|
||||
{
|
||||
self::$semaphore[$key] = sem_get(self::semaphoreKey($key));
|
||||
if (self::$semaphore[$key]) {
|
||||
|
@ -49,7 +49,7 @@ class SemaphoreLockDriver extends AbstractLockDriver
|
|||
/**
|
||||
* (@inheritdoc)
|
||||
*/
|
||||
public function release($key)
|
||||
public function releaseLock($key)
|
||||
{
|
||||
if (empty(self::$semaphore[$key])) {
|
||||
return false;
|
||||
|
@ -66,6 +66,6 @@ class SemaphoreLockDriver extends AbstractLockDriver
|
|||
*/
|
||||
public function isLocked($key)
|
||||
{
|
||||
return @sem_get(self::$semaphore[$key]) !== false;
|
||||
return isset(self::$semaphore[$key]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue