1 <?php
2 3 4 5 6 7 8 9 10
11
12 class CliDebugView extends DebugView {
13
14 15 16
17 public function ($httpRequest = null) {
18 }
19
20 21 22
23 public function () {
24 }
25
26 27 28
29 public function writeError($httpRequest, $errno, $errstr, $errfile, $errline, $errcontext) {
30 $errorType = self::$error_types[$errno];
31 echo SS_Cli::text("ERROR [" . $errorType['title'] . "]: $errstr\nIN $httpRequest\n", "red", null, true);
32 echo SS_Cli::text("Line $errline in $errfile\n\n", "red");
33 }
34
35 36 37 38
39 function writeSourceFragment($lines, $errline) {
40 echo "Source\n======\n";
41 foreach($lines as $offset => $line) {
42 echo ($offset == $errline) ? "* " : " ";
43 echo str_pad("$offset:",5);
44 echo wordwrap($line, 100, "\n ");
45 }
46 echo "\n";
47 }
48
49 50 51
52 function writeTrace($trace = null) {
53 echo "Trace\n=====\n";
54 echo SS_Backtrace::get_rendered_backtrace($trace ? $trace : debug_backtrace(), true);
55 }
56
57 58 59 60 61 62
63 public function writeInfo($title, $subtitle, $description=false) {
64 echo wordwrap(strtoupper($title),100) . "\n";
65 echo wordwrap($subtitle,100) . "\n";
66 echo str_repeat('-',min(100,max(strlen($title),strlen($subtitle)))) . "\n";
67 echo wordwrap($description,100) . "\n\n";
68 }
69
70 }
71
72 ?>
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-