class VarDumperDebug in VarDumper 7
Same name and namespace in other branches
- 8 src/VarDumper/VarDumperDebug.php \Drupal\vardumper\VarDumper\VarDumperDebug
Hierarchy
- class \Drupal\vardumper\VarDumper\VarDumperDebug
Expanded class hierarchy of VarDumperDebug
3 files declare their use of VarDumperDebug
- VarDumperBlock.php in modules/
vardumper_block/ src/ VarDumper/ VarDumperBlock.php - Contains Drupal\vardumper_block\VarDumper\VarDumperBlock.
- VarDumperConsole.php in modules/
vardumper_console/ src/ VarDumper/ VarDumperConsole.php - Contains Drupal\vardumper_console\VarDumper\VarDumperConsole.
- VarDumperWatchdog.php in modules/
vardumper_watchdog/ src/ VarDumper/ VarDumperWatchdog.php - Contains Drupal\vardumper_watchdog\VarDumper\VarDumperWatchdog.
File
- src/
VarDumper/ VarDumperDebug.php, line 15 - Contains Drupal\vardumper\VarDumper\VarDumperDebug.
Namespace
Drupal\vardumper\VarDumperView source
class VarDumperDebug {
protected $header1 = "<em>Dump called from <strong>%s</strong>, line <strong>%d</strong> at <strong>%s</strong>.</em>";
protected $header2 = "<em><strong>%s</strong> :: Dump called from <strong>%s</strong>, line <strong>%d</strong> at <strong>%s</strong>.</em>";
/**
*
*/
public function getHeaders($name, $d) {
$time = explode(' ', microtime());
$time = date("H:i:s") . '.' . round($time[0], 4) * 10000;
$result = sprintf($this->header1, $d['file'], $d['line'], $time);
if (!empty($name)) {
$result = sprintf($this->header2, $name, $d['file'], $d['line'], $time);
}
return $result;
}
/**
*
*/
public function getDebugInformation() {
$_ = array_reverse(debug_backtrace());
while ($d = array_pop($_)) {
if (strpos(@$d['file'], 'src/VarDumper') === FALSE && strpos(@$d['file'], 'vardumper') === FALSE) {
break;
}
}
return $d;
}
/**
*
*/
public function getDebug($var) {
$memory = fopen('php://memory', 'r+b');
$cloner = new VarCloner();
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDrupalDumper();
$dumper
->dump($cloner
->cloneVar($var), $memory);
return stream_get_contents($memory, -1, 0);
}
/**
*
*/
public function hasPermission() {
return $this->drupal7
->user_access('access vardumper information');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
VarDumperDebug:: |
protected | property | ||
VarDumperDebug:: |
protected | property | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function | ||
VarDumperDebug:: |
public | function |