yaf 添加phpunittest

首先要讓php在cli下支持yaf
wamp下打開D:/wamp/bin/php/php5.5.12/php.ini
在extension=php_xsl.dll下面輸入
extension=php_yaf.dll
yaf.environ=dev
;yaf.use_namespace=0

然後重啟apache。

在項目目錄下新建一個test的入口文件,/public/indexTest.php

<?php

define('ROOT_PATH',  realpath(dirname(dirname(__FILE__))));
define('APPLICATION_PATH',  ROOT_PATH . '/application');

$application = new Yaf_Application(ROOT_PATH . "/conf/application.ini");
$application->bootstrap();
$application->getDispatcher()->dispatch(new Yaf_Request_Simple());
?>



在cmd中執行php public/indexTest.php /Index/index

輸出module Index controller Index action index的內容。

猜你喜欢

转载自lhdst-163-com.iteye.com/blog/2237034
今日推荐