This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* General info: | |
* Embed this code in your lithium (li3) app. | |
* At the end of the app\config\connections.php for example. | |
* | |
* Uncomment the var_dump lines OR use the lithium Logger Class | |
* Use/modify the first callback, if you just want to see the query array data. | |
* Use the second callback for dumping the raw sql data. | |
* | |
* @author: 2011 weluse GmbH, Marc Schwering | |
*/ | |
Connections::get("default")->applyFilter("read", function($self, $params, $chain) { | |
$response = $chain->next($self, $params, $chain); | |
if (is_a($params['query'], 'lithium\data\model\Query')) { | |
/** | |
* dump the query-object-data as array: | |
*/ | |
//var_dump($params['query']->export($self)); | |
/** | |
* dump the result: | |
*/ | |
//var_dump($res->data()); | |
} // | |
return $response; | |
}); | |
Connections::get('default')->applyFilter("_execute", function($self, $params, $chain) { | |
$response = $chain->next($self, $params, $chain); | |
/** | |
* dump the raw sql query: | |
*/ | |
//var_dump($params['sql']); | |
return $response; | |
}); |
\lithium\analysis\Logger\Logger::write('info', $your_data_as_str);
Keine Kommentare:
Kommentar veröffentlichen