Yaf(Yet Another Framework)用户手册

 
 

最后更新: $Id: userguide.xml 7335 2019-09-08 12:01:33Z laruence $


目录

前言
1. 关于Yaf
1.1. Yaf的特点
1.2. Yaf的优点
1.3. 流程图
1.4. Yaf的性能
对比
测试结果
1个并发
100个并发
说明
2. Yaf安装/配置
2.1. Yaf的安装
在 Linux 系统下安装
PHP 5.2+
在 Windows 系统下安装
PHP 5.2+
2.2. Yaf定义的常量
2.3. Yaf的配置项
3. 快速开始
3.1. 需要些什么?
3.2. Hello World
目录结构
入口文件
重写规则
配置文件
控制器
视图文件
运行
3.3. 使用代码生成工具
4. 配置文件
4.1. 必要的配置项
4.2. 可选的配置项
5. 自动加载器
5.1. 全局类和自身类(本地类)
5.2. 类的加载规则
6. 使用Bootstrap
6.1. 简介
6.2. 使用Bootstrap
7. 使用插件
7.1. 简介
7.2. Yaf支持的Hook
7.3. 定义插件
7.4. 注册插件
7.5. 插件目录
8. 路由和路由协议
8.1. 概述
8.2. 设计
8.3. 默认情况
8.4. 使用路由
8.5. 路由协议详解
默认路由协议
Yaf_Route_Simple
Yaf_Route_Supervar
Yaf_Route_Map
Yaf_Route_Rewrite
Yaf_Route_Regex
8.6. 自定义路由协议
9. 在命令行使用Yaf
9.1. 简介
9.2. 使用样例
9.3. 分发请求
10. 异常和错误
10.1. 概述
10.2. 异常模式
10.3. 错误模式
11. 内建的类
11.1. Yaf_Application
Yaf_Application::__construct
Yaf_Application::bootstrap
Yaf_Application::app
Yaf_Application::environ
Yaf_Application::run
Yaf_Application::execute
Yaf_Application::getDispatcher
Yaf_Application::getConfig
Yaf_Application::getModules
11.2. Yaf_Bootstrap_Abstract
11.3. Yaf_Loader
Yaf_Loader::getInstance
Yaf_Loader::import
Yaf_Loader::autoload
Yaf_Loader::registerLocalNamespace
Yaf_Loader::isLocalName
Yaf_Loader::getLocalNamespace
Yaf_Loader::clearLocalNamespace
11.4. Yaf_Dispatcher
Yaf_Dispatcher::getInstance
Yaf_Dispatcher::disableView
Yaf_Dispatcher::enableView
Yaf_Dispatcher::autoRender
Yaf_Dispatcher::returnResponse
Yaf_Dispatcher::flushInstantly
Yaf_Dispatcher::setErrorHandler
Yaf_Dispatcher::getApplication
Yaf_Dispatcher::getRouter
Yaf_Dispatcher::getRequest
Yaf_Dispatcher::registerPlugin
Yaf_Dispatcher::setAppDirectory
Yaf_Dispatcher::setRequest
Yaf_Dispatcher::initView
Yaf_Dispatcher::setView
Yaf_Dispatcher::setDefaultController
Yaf_Dispatcher::setDefaultModule
Yaf_Dispatcher::setDefaultAction
Yaf_Dispatcher::throwException
Yaf_Dispatcher::catchException
Yaf_Dispatcher::dispatch
11.5. Yaf_Plugin_Abstract
11.6. Yaf_Registry
Yaf_Registry::set
Yaf_Registry::get
Yaf_Registry::has
Yaf_Registry::del
11.7. Yaf_Session
11.8. Yaf_Config_Abstract
Yaf_Config_Ini
Yaf_Config_Simple
11.9. Yaf_Controller_Abstract
Yaf_Controller_Abstract::getModuleName
Yaf_Controller_Abstract::getRequest
Yaf_Controller_Abstract::getResponse
Yaf_Controller_Abstract::getView
Yaf_Controller_Abstract::initView
Yaf_Controller_Abstract::setViewPath
Yaf_Controller_Abstract::getViewPath
Yaf_Controller_Abstract::render
Yaf_Controller_Abstract::display
Yaf_Controller_Abstract::forward
Yaf_Controller_Abstract::redirect
11.10. Yaf_Action_Abstract
11.11. Yaf_View_Interface
Yaf_View_Simple
Yaf_View_Simple::assign
Yaf_View_Simple::render
Yaf_View_Simple::display
Yaf_View_Simple::setScriptPath
Yaf_View_Simple::getScriptPath
Yaf_View_Simple::__set
Yaf_View_Simple::__get
Yaf_View_Simple::get
11.12. Yaf_Request_Abstract
Yaf_Request_Http
Yaf_Request_Simple
Yaf_Request_Abstract::getException
Yaf_Request_Abstract::getModuleName
Yaf_Request_Abstract::getControllerName
Yaf_Request_Abstract::getActionName
Yaf_Request_Abstract::getParams
Yaf_Request_Abstract::getParam
Yaf_Request_Abstract::setParam
Yaf_Request_Abstract::getMethod
Yaf_Request_Abstract::isCli
Yaf_Request_Abstract::isGet
11.13. Yaf_Response_Abstract
Yaf_Response_Http
Yaf_Response_Cli
Yaf_Response_Abstract::setBody
Yaf_Response_Abstract::appendBody
Yaf_Response_Abstract::prependBody
Yaf_Response_Abstract::getBody
Yaf_Response_Abstract::clearBody
Yaf_Response_Abstract::response
Yaf_Response_Abstract::setRedirect
Yaf_Response_Abstract::__toString
11.14. Yaf_Router
Yaf_Router::addRoute
Yaf_Config::addConfig
Yaf_Router::getRoutes
Yaf_Router::getRoute
Yaf_Router::getCurrentRoute
Yaf_Router::isModuleName
Yaf_Router::route
11.15. Yaf_Route_Interface
11.16. Yaf_Exception
Yaf_Exception_StartupError
Yaf_Exception_RouterFailed
Yaf_Exception_DispatchFailed
Yaf_Exception_LoadFailed
Yaf_Exception_LoadFailed_Module
Yaf_Exception_LoadFailed_Controller
Yaf_Exception_LoadFailed_Action
Yaf_Exception_LoadFailed_View
Yaf_Exception_TypeError