Class yii\debug\panels\ConfigPanel
Inheritance | yii\debug\panels\ConfigPanel » yii\debug\Panel » yii\base\Component |
---|---|
Available since extension's version | 2.0 |
Source Code | https://github.com/yiisoft/yii2-debug/blob/master/src/panels/ConfigPanel.php |
Debugger panel that collects and displays application configuration and environment.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$actions | array | Array of actions to add to the debug modules default controller. | yii\debug\Panel |
$data | mixed | Data associated with panel | yii\debug\Panel |
$detail | string | Content that is displayed in debugger detail view. | yii\debug\Panel |
$error | yii\debug\FlattenException|null | Error while saving the panel | yii\debug\Panel |
$extensions | array | This property is read-only. | yii\debug\panels\ConfigPanel |
$id | string | Panel unique identifier. | yii\debug\Panel |
$module | yii\debug\Module | yii\debug\Panel | |
$name | string | Name of the panel. | yii\debug\Panel |
$phpInfo | array | This property is read-only. | yii\debug\panels\ConfigPanel |
$summary | string | Content that is displayed at debug toolbar. | yii\debug\Panel |
$tag | string | Request data set identifier. | yii\debug\Panel |
$url | string | URL pointing to panel detail view. | yii\debug\Panel |
Public Methods
Method | Description | Defined By |
---|---|---|
getDetail() | yii\debug\panels\ConfigPanel | |
getError() | yii\debug\Panel | |
getExtensions() | Returns data about extensions | yii\debug\panels\ConfigPanel |
getName() | yii\debug\panels\ConfigPanel | |
getPhpInfo() | Returns the BODY contents of the phpinfo() output | yii\debug\panels\ConfigPanel |
getSummary() | yii\debug\panels\ConfigPanel | |
getTraceLine() | Returns a trace line | yii\debug\Panel |
getUrl() | yii\debug\Panel | |
hasError() | yii\debug\Panel | |
isEnabled() | Checks whether this panel is enabled. | yii\debug\Panel |
load() | Loads data into the panel | yii\debug\Panel |
save() | Saves data to be later used in debugger detail view. | yii\debug\panels\ConfigPanel |
setError() | yii\debug\Panel |
Property Details
Method Details
public string getDetail ( ) | ||
return | string |
Content that is displayed in debugger detail view |
---|
public function getDetail()
{
return Yii::$app->view->render('panels/config/detail', ['panel' => $this]);
}
Defined in: yii\debug\Panel::getError()
public yii\debug\FlattenException|null getError ( ) |
public function getError()
{
return $this->error;
}
Returns data about extensions
public array getExtensions ( ) |
public function getExtensions()
{
$data = [];
foreach ($this->data['extensions'] as $extension) {
$data[$extension['name']] = $extension['version'];
}
ksort($data);
return $data;
}
public string getName ( ) | ||
return | string |
Name of the panel |
---|
public function getName()
{
return 'Configuration';
}
Returns the BODY contents of the phpinfo() output
public array getPhpInfo ( ) |
public function getPhpInfo()
{
ob_start();
phpinfo();
$pinfo = ob_get_contents();
ob_end_clean();
$phpinfo = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $pinfo);
$phpinfo = str_replace('<table', '<div class="table-responsive"><table class="table table-condensed table-bordered table-striped table-hover config-php-info-table" ', $phpinfo);
$phpinfo = str_replace('</table>', '</table></div>', $phpinfo);
return $phpinfo;
}
public string getSummary ( ) | ||
return | string |
Content that is displayed at debug toolbar |
---|
public function getSummary()
{
return Yii::$app->view->render('panels/config/summary', ['panel' => $this]);
}
Defined in: yii\debug\Panel::getTraceLine()
Returns a trace line
public string getTraceLine ( $options ) | ||
$options | array |
The array with trace |
return | string |
The trace line |
---|
public function getTraceLine($options)
{
if (!isset($options['text'])) {
$options['text'] = "{$options['file']}:{$options['line']}";
}
$traceLine = $this->module->traceLine;
if ($traceLine === false) {
return $options['text'];
}
$options['file'] = str_replace('\\', '/', $options['file']);
$rawLink = $traceLine instanceof \Closure ? $traceLine($options, $this) : $traceLine;
return strtr($rawLink, ['{file}' => $options['file'], '{line}' => $options['line'], '{text}' => $options['text']]);
}
Defined in: yii\debug\Panel::getUrl()
public string getUrl ( $additionalParams = null ) | ||
$additionalParams | null|array |
Optional additional parameters to add to the route |
return | string |
URL pointing to panel detail view |
---|
public function getUrl($additionalParams = null)
{
$route = [
'/' . $this->module->id . '/default/view',
'panel' => $this->id,
'tag' => $this->tag,
];
if (is_array($additionalParams)){
$route = ArrayHelper::merge($route, $additionalParams);
}
return Url::toRoute($route);
}
Defined in: yii\debug\Panel::hasError()
public boolean hasError ( ) |
public function hasError()
{
return $this->error !== null;
}
Defined in: yii\debug\Panel::isEnabled()
Checks whether this panel is enabled.
public boolean isEnabled ( ) | ||
return | boolean |
Whether this panel is enabled. |
---|
public function isEnabled()
{
return true;
}
Defined in: yii\debug\Panel::load()
Loads data into the panel
public void load ( $data ) | ||
$data | mixed |
public function load($data)
{
$this->data = $data;
}
Saves data to be later used in debugger detail view.
This method is called on every page where debugger is enabled.
public mixed save ( ) | ||
return | mixed |
Data to be saved |
---|
public function save()
{
return [
'phpVersion' => PHP_VERSION,
'yiiVersion' => Yii::getVersion(),
'application' => [
'yii' => Yii::getVersion(),
'name' => Yii::$app->name,
'version' => Yii::$app->version,
'language' => Yii::$app->language,
'sourceLanguage' => Yii::$app->sourceLanguage,
'charset' => Yii::$app->charset,
'env' => YII_ENV,
'debug' => YII_DEBUG,
],
'php' => [
'version' => PHP_VERSION,
'xdebug' => extension_loaded('xdebug'),
'apc' => extension_loaded('apc'),
'memcache' => extension_loaded('memcache'),
'memcached' => extension_loaded('memcached'),
],
'extensions' => Yii::$app->extensions,
];
}
Defined in: yii\debug\Panel::setError()
public void setError ( yii\debug\FlattenException $error ) | ||
$error | yii\debug\FlattenException |
public function setError(FlattenException $error)
{
$this->error = $error;
}