PHP 클래스 phprs\Invoker

저자: caoym
파일 보기 프로젝트 열기: caoym/phprs-restful 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$method_name

공개 메소드들

메소드 설명
__construct ( Container $ins, string $method )
__invoke ( Request $request, Response &$response ) 执行API
bind ( integer $id, string $type, $param ) 绑定参数,返回值,异常
check ( ) 检查参数是否均已经绑定
getBindParamPos ( ) : array 获取被绑定的参数列表 返回的是参数位置
getClassName ( ) : string
getContainer ( ) : object
getMethodName ( ) : string
getParams ( ) 绑定的参数
getReturns ( ) 绑定的返回值
getThrows ( ) 绑定的异常

메소드 상세

__construct() 공개 메소드

public __construct ( Container $ins, string $method )
$ins Container 被调用的实例容器
$method string 被调用的实例方法

__invoke() 공개 메소드

执行API
public __invoke ( Request $request, Response &$response )
$request Request 请求
$response Response 响应

bind() 공개 메소드

绑定参数,返回值,异常
public bind ( integer $id, string $type, $param )
$id integer 参数id
$type string 绑定类型 param/return/throws
$param param: [['arg_name'=>'$._SERVER.REQUEST_URI'],...] [[参数名=>jsonpath表达式],...] 指定api接口参数从http请求中获取的方式 returns: 指定哪些参数被作为返回值 [ ['status','200 OK'], 200 OK 作为常量, 输出到status ['cookie','$arg0'], $arg0变量输出到cookie ['body'], 未指定变量, 则取返回值输出 ] throws 指定根据不同的异常设置响应信息 [ ['MyException','status' , '404 Not Found'], ['MyException','body','$msg'], ['Exception','status','500 Internal Server Error'], ]

check() 공개 메소드

检查参数是否均已经绑定
public check ( )

getBindParamPos() 공개 메소드

获取被绑定的参数列表 返回的是参数位置
public getBindParamPos ( ) : array
리턴 array

getClassName() 공개 메소드

public getClassName ( ) : string
리턴 string

getContainer() 공개 메소드

public getContainer ( ) : object
리턴 object

getMethodName() 공개 메소드

public getMethodName ( ) : string
리턴 string

getParams() 공개 메소드

绑定的参数
public getParams ( )

getReturns() 공개 메소드

绑定的返回值
public getReturns ( )

getThrows() 공개 메소드

绑定的异常
public getThrows ( )

프로퍼티 상세

$method_name 공개적으로 프로퍼티

public $method_name