增長Cross\Core\Delegate::on
方法, 用於在框架執行流程中執行自定義函數php
$web = Cross\Core\Delegate::loadApp('web'); $web->on('dispatcher', function() use($web) { echo 'before dispatcher'; }); $web->on('obRender', function($content) use($web) { echo 'after obRender'; }); $web->run();
加強REST運行方式web
$web = Cross\Core\Delegate::loadApp('web'); $rest = $web->rest(); $rest->get('/', function() { echo 'Hello CrossPHP!'; }); $rest->run();
參數及正則驗證app
$web = Cross\Core\Delegate::loadApp('web'); $rest = $web->rest(); $rest->rules(array( 'name' => "/^\w+$/", )); $rest->get('/hi-{:name}', function ($name) { echo 'Hi ' . $name; }); $rest->run();
和MVC結合框架
$web = Cross\Core\Delegate::loadApp('web'); $rest = $web->rest(); $rest->get('/', function () use ($web) { $web->get('main:index'); }); $rest->run();
增長數據表前綴配置, 在db.config.php
中使用prefix
指定, 手動拼接SQL時, 須要調用 $this->getPrefix('table')
來獲取完整表名, 其餘使用方式不變函數
修改了app的啓動方式, 加強了各app之間的獨立性, 調整了繼承關係, FrameBase再也不從Application繼承優化
修復mRun不能正確識別請求uri的bugthis
$web = Cross\Core\Delegate::loadApp('web'); $web->map('/hello', 'Main:index'); $web->mRun(); `map`和`mRun()`用於限制訪問, 只有在`map`中註冊的uri才生效
運行在CLI模式下時,再也不發送HTTP頭spa
Application::initController()
, 更早捕獲異常rest
去掉Cross\Core\Delegate::cliRun()
中的一箇中間變量code
調整cli模式下的異常模板
可見性及註釋調整
優化自動加載時對文件是否存在的判斷
Router
新增一個方法, 用於統一獲取請求URI
簡化config
類, parse方法再也不支持文件
rRun()
方法的第一個參數, 只需實現RouterInterface接口. 取消rRun()
的第二個參數
優化Response
中的contentType
設置