This commit is contained in:
2021-02-22 17:44:24 +08:00
parent 3b09b9a308
commit 2d1f83cf09
34 changed files with 732 additions and 222 deletions
+37
View File
@@ -2,6 +2,7 @@
defined('APP_PATH') or define('APP_PATH', __DIR__ . '/../../');
use Annotation\Annotation;
use HttpServer\Http\HttpParams;
use HttpServer\Http\Request;
use HttpServer\Http\Response;
@@ -38,6 +39,22 @@ if (!function_exists('make')) {
}
if (!function_exists('annotation')) {
/**
* @return Annotation
* @throws ComponentException
*/
function annotation(): Annotation
{
return Snowflake::app()->getAttributes();
}
}
if (!function_exists('isUrl')) {
@@ -395,6 +412,26 @@ if (!function_exists('storage')) {
}
if (!function_exists('listen')) {
/**
* @param $name
* @param $callback
* @param $params
* @param $isAppend
* @throws ComponentException
* @throws Exception
*/
function listen($name, $callback, $params = [], $isAppend = true)
{
$event = Snowflake::app()->getEvent();
$event->on($name, $callback, $params, $isAppend);
}
}
if (!function_exists('alias')) {
/**