public function processLogs($logs)
{
$app = Yii::app();
$config = array();
$ip = $app->request->getUserHostAddress();
$allowed = false;
foreach ($this->allowedIPs as $pattern) {
// if found any char other than [0-9] and dot, treat pattern as a regexp
if (preg_match('/[^0-9:\\.]/', $pattern)) {
if (preg_match('/' . $pattern . '/', $ip)) {
$allowed = true;
break;
}
} else {
if ($pattern === $ip) {
$allowed = true;
break;
}
}
}
if (!$allowed) {
return;
}
foreach (explode(',', $this->config) as $value) {
$value = trim($value);
$config[$value] = true;
}
//Checking for an AJAX Requests
if (!$app instanceof CWebApplication || $app->getRequest()->getIsAjaxRequest()) {
return;
}
//Checking for an DEBUG mode of running app
if (isset($config['runInDebug']) && (!DEFINED('YII_DEBUG') || YII_DEBUG == false)) {
return;
}
$items = array();
$items[] = yiiDebugConfig::getInfo($logs, $config);
$items[] = yiiDebugMem::getInfo($logs);
$items[] = yiiDebugTime::getInfo($logs);
$items[] = yiiDebugDB::getInfo($logs);
$items[] = yiiDebugTrace::getInfo($logs);
$panel = new yiiDebugPanel();
$panel->render($items, $config);
}