ThinkPHP3.2 使用repl模式

1,新建一个Controller,如ReplController.class.php
[php]
<?php
namespace Home\Controller;
use Think\Controller;
class ReplController extends Controller
{
function index()
{
$Boris = new \Behavior\BorisBehavior();
$Boris ->run();
}
[/php]

2,使用命令行进入repl模式
[shell]
php index.php Repl
[/shell]

使用效果如下
[shell]
➜ thinkphp git:(master) ✗ php index.php
REPL MODE FOR THINKPHP
THINKPHP_VERSION: 3.2.3beta, PHP_VERSION: 5.5.14, BORIS_VERSION: 1.0.8
[1] >>> $model = D("UserActLog");
// object(Home\Model\UserActlogModel)(
//
// )
[2] >>> $model->count();
// 1322112
[3] >>> $model->_sql();
// 'kingsgame.user_act_log.count()'
[4] >>> A("Index")->hello();
Hello world// NULL
[5] >>>
[/shell]

发表评论