Inheritance: extends yiiDebugClass
Example #1
0
 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);
 }
Example #2
0
 public function processLogs($logs)
 {
     $app = Yii::app();
     $config = array();
     if ($this->allowedIPs && !in_array($app->request->getUserHostAddress(), $this->allowedIPs)) {
         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);
 }
Example #3
0
 public function processLogs($logs)
 {
     if (!$this->_isLoggerAllowed()) {
         return;
     }
     $items = array();
     $items[] = yiiDebugConfig::getInfo($logs, $this->_config);
     $items[] = yiiDebugMem::getInfo($logs);
     $items[] = yiiDebugTime::getInfo($logs);
     $items[] = yiiDebugDB::getInfo($logs);
     $items[] = yiiDebugTrace::getInfo($logs);
     $panel = new yiiDebugPanel();
     $panel->render($items, $this->_config);
 }