modify
This commit is contained in:
@@ -235,10 +235,7 @@ class Loader extends BaseObject
|
|||||||
$path = '/' . trim($path, '/');
|
$path = '/' . trim($path, '/');
|
||||||
foreach ($this->_directory as $key => $_path) {
|
foreach ($this->_directory as $key => $_path) {
|
||||||
$key = '/' . trim($key, '/');
|
$key = '/' . trim($key, '/');
|
||||||
if (!str_starts_with($key, $path)) {
|
if (!str_starts_with($key, $path) || in_array($key, $outPath)) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (in_array($key, $outPath)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$this->execute($_path);
|
$this->execute($_path);
|
||||||
|
|||||||
+4
-10
@@ -71,21 +71,15 @@ class Channel extends Component
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function pop(string $name, Closure $closure, int|float $timeout = null): mixed
|
public function pop(string $name, Closure $closure): mixed
|
||||||
{
|
{
|
||||||
if (($channel = $this->channelInit($name)) == false) {
|
if (($channel = $this->channelInit($name)) == false) {
|
||||||
return $this->addError('Channel is full.');
|
return $this->addError('Channel is full.');
|
||||||
}
|
}
|
||||||
if (!$channel->isEmpty()) {
|
if ($channel->isEmpty()) {
|
||||||
return $channel->shift();
|
return call_user_func($closure);
|
||||||
}
|
}
|
||||||
if ($timeout !== null) {
|
return $channel->dequeue();
|
||||||
$data = $channel->dequeue();
|
|
||||||
}
|
|
||||||
if (empty($data)) {
|
|
||||||
$data = call_user_func($closure);
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user