diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..44b4224 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3b52db --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# local workspace +*.sublime-workspace \ No newline at end of file diff --git a/application/Bootstrap.php b/application/Bootstrap.php index fbbd092..d7c0f6e 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -7,25 +7,25 @@ * 这些方法, 都接受一个参数:Yaf_Dispatcher $dispatcher * 调用的次序, 和申明的次序相同 */ -class Bootstrap extends Yaf_Bootstrap_Abstract{ +class Bootstrap extends Yaf\Bootstrap_Abstract{ public function _initConfig() { //把配置保存起来 - $arrConfig = Yaf_Application::app()->getConfig(); + $arrConfig = Yaf\Application::app()->getConfig(); Yaf_Registry::set('config', $arrConfig); } - public function _initPlugin(Yaf_Dispatcher $dispatcher) { + public function _initPlugin(Yaf\Dispatcher $dispatcher) { //注册一个插件 $objSamplePlugin = new SamplePlugin(); $dispatcher->registerPlugin($objSamplePlugin); } - public function _initRoute(Yaf_Dispatcher $dispatcher) { + public function _initRoute(Yaf\Dispatcher $dispatcher) { //在这里注册自己的路由协议,默认使用简单路由 } - - public function _initView(Yaf_Dispatcher $dispatcher){ + + public function _initView(Yaf\Dispatcher $dispatcher){ //在这里注册自己的view控制器,例如smarty,firekylin } } diff --git a/application/controllers/Error.php b/application/controllers/Error.php index db5bce3..53ce719 100644 --- a/application/controllers/Error.php +++ b/application/controllers/Error.php @@ -5,12 +5,12 @@ * @see http://www.php.net/manual/en/yaf-dispatcher.catchexception.php * @author young-pc\young */ -class ErrorController extends Yaf_Controller_Abstract { +class ErrorController extends Yaf\Controller_Abstract { //从2.1开始, errorAction支持直接通过参数获取异常 public function errorAction($exception) { //1. assign to view engine $this->getView()->assign("exception", $exception); - //5. render by Yaf + //5. render by Yaf } } diff --git a/application/controllers/Index.php b/application/controllers/Index.php index ca24cb1..066aec6 100644 --- a/application/controllers/Index.php +++ b/application/controllers/Index.php @@ -5,7 +5,7 @@ * @desc 默认控制器 * @see http://www.php.net/manual/en/class.yaf-controller-abstract.php */ -class IndexController extends Yaf_Controller_Abstract { +class IndexController extends Yaf\Controller_Abstract { /** * 默认动作 diff --git a/application/plugins/Sample.php b/application/plugins/Sample.php index 40912e8..85ce1b3 100644 --- a/application/plugins/Sample.php +++ b/application/plugins/Sample.php @@ -5,23 +5,23 @@ * @see http://www.php.net/manual/en/class.yaf-plugin-abstract.php * @author young-pc\young */ -class SamplePlugin extends Yaf_Plugin_Abstract { +class SamplePlugin extends Yaf\Plugin_Abstract { - public function routerStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function routerStartup(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } - public function routerShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function routerShutdown(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } - public function dispatchLoopStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function dispatchLoopStartup(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } - public function preDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function preDispatch(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } - public function postDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function postDispatch(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } - public function dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response) { + public function dispatchLoopShutdown(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response) { } } diff --git a/doglive.sublime-project b/doglive.sublime-project new file mode 100644 index 0000000..24db303 --- /dev/null +++ b/doglive.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "." + } + ] +} diff --git a/index.php b/index.php index 63b2c0c..2292a1f 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,6 @@ run(); -echo "\n"; -echo __DIR__; \ No newline at end of file