yiiDebugConfig::getInfo PHP Method

getInfo() public static method

public static getInfo ( $data, $config = null )
    public static function getInfo($data, $config = null)
    {
        parent::getInfo($data, $config);
        $result = array();
        $result['title'] = 'Yii ver: ' . Yii::getVersion();
        $result['headinfo'] = self::getHeadInfo();
        $result['panelTitle'] = 'Configuration';
        $result['content'] = self::formatArrayAsHtml('globals', self::globalsAsArray(), true);
        $result['content'] .= self::formatArrayAsHtml('session', self::sessionAsArray(), true);
        $result['content'] .= self::formatArrayAsHtml('php', self::phpInfoAsArray(), true);
        $result['content'] .= self::formatArrayAsHtml('request', self::requestAsArray(), true);
        $result['content'] .= self::formatArrayAsHtml('Yii::app()', self::YiiAppAsArray(), true);
        $result['content'] .= self::formatArrayAsHtml('WebdebugToolbar', self::$_config, true);
        return $result;
    }

Usage Example

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);
 }
All Usage Examples Of yiiDebugConfig::getInfo