处理 CLI or HTTP 请求

概述

Seagull检测应用程序的请求类型并分别处理。如果请求是来自于浏览器或网络设备,则进行HTTP初始化。如果是命令行模式,则运行命令行初始化。

HTTP 请求

对于HTTP请求,URI是根据载入的分析策略解析,而且相关的数据被提取。请看这时详细介绍。

CLI 请求

如果Seagull 侦测到一个CLI 请求,一个类似的初始化发生了,不过使用更少的参数。 下面是一个典型的调用CLI的实例。

$ php seagull/www/index.php –moduleName=foo –managerName=bar –action=myAction 任何参数都必须以 name ⇒ value 形式。以‘--‘开头的属性必须跟着一个’=‘。

 如:

$ php seagull/www/index.php –moduleName=foo –managerName=bar –action=myAction –customVariable=true –fileName=/path/to/file.xml

如果参数格式不对,那么将会产生CLI parameters invalid的错误。

你可以通过SGL_Request对象来存取你的参数。

mwattier的评论 (on Thu Nov 30 19:08:09 2006)

对于0.6.1版本,CLI request的身份认证不被处理。所有需要权限验证的模块必须把配置文件中的requiresAuth配置选项设置为false。看 ticket 1324 实例。

[ImportMgr]
requiresAuth=false
 
howto/workingwithcliorhttprequests.txt · 最后更改: 2010/05/30 00:21 (外部编辑)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2