php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

PDO data collecting through AJAX in Yii 1.1

Open homeoftheunits opened this issue 7 years ago • 0 comments

Hi,

i implement the debugbar in Yii, and i extend the Yii CDbConnection Class:

`

use DebugBar\DataCollector\PDO\TraceablePDO;

class DBarDbConnection extends CDbConnection { protected function createPdoInstance() { $instance = parent::createPdoInstance();

    if(!Yii::app() instanceof CConsoleApplication)
    {
        $debugbar = DBar::getInstance();
        if ($debugbar)
		{
			$debugbar->pdo = new TraceablePDO($instance);
			$debugbar->saveInstance($debugbar);
		}
    }

    return $instance;
}

} `

This works, but not for AJAX Calls, has anybody an idea?

Cheers Ralf

homeoftheunits avatar Sep 27 '17 07:09 homeoftheunits