4 Commits

Author SHA1 Message Date
as2252258 6ae7f5a721 eee 2024-11-21 10:43:16 +08:00
as2252258 9775d16db5 eee 2024-11-06 21:47:21 +08:00
as2252258 03bffb5e5b eee 2024-11-06 21:41:43 +08:00
as2252258 a21b949512 eee 2024-02-09 17:08:07 +08:00
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ class CoroutineContext implements ContextInterface
*/
public static function inCoroutine(): bool
{
return true;
return Coroutine::getCid() > -1;
}
+8 -1
View File
@@ -83,6 +83,9 @@ class Scanner extends Component
{
try {
require_once "$path";
if (!isset($_SERVER['PWD'])) {
$_SERVER['PWD'] = APP_PATH;
}
$path = str_replace($_SERVER['PWD'], '', $path);
$path = str_replace('.php', '', $path);
$this->parseFile($path);
@@ -119,7 +122,11 @@ class Scanner extends Component
if (!class_exists($attribute->getName())) {
continue;
}
$attribute->newInstance()->dispatch($class, $method->getName());
$instance = $attribute->newInstance();
if (!method_exists($instance, 'dispatch')) {
continue;
}
$instance->dispatch($class, $method->getName());
}
}
}