Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ae7f5a721 | |||
| 9775d16db5 | |||
| 03bffb5e5b | |||
| a21b949512 |
@@ -14,7 +14,7 @@ class CoroutineContext implements ContextInterface
|
|||||||
*/
|
*/
|
||||||
public static function inCoroutine(): bool
|
public static function inCoroutine(): bool
|
||||||
{
|
{
|
||||||
return true;
|
return Coroutine::getCid() > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -83,6 +83,9 @@ class Scanner extends Component
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
require_once "$path";
|
require_once "$path";
|
||||||
|
if (!isset($_SERVER['PWD'])) {
|
||||||
|
$_SERVER['PWD'] = APP_PATH;
|
||||||
|
}
|
||||||
$path = str_replace($_SERVER['PWD'], '', $path);
|
$path = str_replace($_SERVER['PWD'], '', $path);
|
||||||
$path = str_replace('.php', '', $path);
|
$path = str_replace('.php', '', $path);
|
||||||
$this->parseFile($path);
|
$this->parseFile($path);
|
||||||
@@ -119,7 +122,11 @@ class Scanner extends Component
|
|||||||
if (!class_exists($attribute->getName())) {
|
if (!class_exists($attribute->getName())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$attribute->newInstance()->dispatch($class, $method->getName());
|
$instance = $attribute->newInstance();
|
||||||
|
if (!method_exists($instance, 'dispatch')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$instance->dispatch($class, $method->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user