function DoctrineDebug::export

Same name in other branches
  1. 5.x src/Plugin/Devel/Dumper/DoctrineDebug.php \Drupal\devel\Plugin\Devel\Dumper\DoctrineDebug::export()

Overrides DevelDumperInterface::export

1 call to DoctrineDebug::export()
DoctrineDebug::exportAsRenderable in src/Plugin/Devel/Dumper/DoctrineDebug.php
Returns a string representation of a variable wrapped in a render array.

File

src/Plugin/Devel/Dumper/DoctrineDebug.php, line 23

Class

DoctrineDebug
Provides a DoctrineDebug dumper plugin.

Namespace

Drupal\devel\Plugin\Devel\Dumper

Code

public function export($input, $name = NULL) {
    $name = $name ? $name . ' => ' : '';
    $variable = Debug::export($input, 6);
    ob_start();
    print_r($variable);
    $dump = ob_get_contents();
    ob_end_clean();
    // Run Xss::filterAdmin on the resulting string to prevent
    // cross-site-scripting (XSS) vulnerabilities.
    $dump = Xss::filterAdmin($dump);
    $config = \Drupal::config('devel.settings');
    $debug_pre = $config->get('debug_pre');
    $dump = ($debug_pre ? '<pre>' : '') . $name . $dump . ($debug_pre ? '</pre>' : '');
    return $this->setSafeMarkup($dump);
}