Skip to content

Commit 228bcff

Browse files
committed
better comments
1 parent 8b4747d commit 228bcff

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Cache/SysVCacheItemPool.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public function __construct($options = [])
109109
$this->items = [];
110110
$this->deferredItems = [];
111111
$this->sysvKey = ftok(__FILE__, $this->options['proj']);
112+
113+
// gracefully handle when `sysvsem` isn't loaded
114+
// @TODO(v2): throw an exception when the extension isn't loaded
112115
if (extension_loaded('sysvsem')) {
113116
$semKey = ftok(__FILE__, $this->options['semProj']);
114117
$this->semId = sem_get($semKey, 1, $this->options['perm'], true);
@@ -119,7 +122,7 @@ private function acquireLock(): bool
119122
{
120123
if ($this->semId === false) {
121124
// if `sysvsem` isn't loaded, or if `sem_get` fails, return true
122-
// this ensures BC with previous behavior
125+
// this ensures BC with previous versions of the auth library.
123126
// @TODO consider better handling when `sem_get` fails.
124127
return true;
125128
}

0 commit comments

Comments
 (0)