欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Yii框架調(diào)試心得--在頁面輸出執(zhí)行sql語句

 更新時間:2014年12月25日 15:25:41   投稿:hebedich  
這篇文章主要介紹了Yii框架調(diào)試心得--在頁面輸出執(zhí)行sql語句,需要的朋友可以參考下

我們使用:yiidebugtb來調(diào)試(因為用他界面比較美觀,不影響界面其他元素)。

1.下載yiidebugtb,并且放入到 application.extensions.yiidebugtb 目錄

2.修改main.php,加入如下代碼:

復(fù)制代碼 代碼如下:

        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning,trace',
                ),

                // 以下是新加
                array( // configuration for the toolbar
                    'class'=>'XWebDebugRouter',
                    'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
                    'levels'=>'error, warning, trace, profile, info',
                    //'categories' => 'system.db.*',
                    'allowedIPs'=>array('127.0.0.1','::1','192\.168\.1[0-5]\.[0-9]{3}','如果程序在外網(wǎng)需要填入你的公網(wǎng)的ip'),
                  ),
               
            ),
        )

3.db鏈接的配置里面做下修改:

復(fù)制代碼 代碼如下:

        'db'=>array(
            'connectionString'=>'mysql:host=*.*.*.*;dbname=test',
            'emulatePrepare'=>true,   // 加入
            'enableParamLogging' => true, // 加入
            'username'=>'-----',
            'password'=>'---',
            'charset'=>'utf8',
            'schemaCachingDuration'=>'0',
            'autoConnect'=>false,
        ),

4.完成

 如:

相關(guān)文章

最新評論