示例#1
0
 function testDebug()
 {
     $var1 = "Variable 1";
     $var2 = "Variable 2";
     Raxan::config('debug', true);
     Raxan::config('debug.output', 'embedded');
     // for embedded/popup html output
     Raxan::debug($var1);
     Raxan::debug($var2);
     $out = htmlspecialchars(Raxan::debugOutut());
     $this->compare($var1 . '<hr />' . $var2, $out, 'Embedded/Popup Debug output');
     Raxan::config('debug.output', 'console');
     // for console/alert non-html output
     $out = Raxan::debugOutut();
     $this->compare($var1 . "\n" . $var2, $out, 'Console/Alert Debug output');
 }
示例#2
0
 /**
  * Send debugging information to client
  * @return RaxanWebPage
  */
 protected function handleDebugResponse()
 {
     $d = Raxan::debugOutut();
     $o = Raxan::config('debug.output');
     if ($o == 'popup' || $o == 'embedded') {
         $d = '<pre><code><strong>Debug Output</strong><hr />' . $d . '</code></pre>';
     }
     if ($o == 'alert') {
         C()->alert($d);
     } else {
         if ($o == 'popup') {
             C()->popup('', 'rxPDI_Debug', 'width=500, scrollbars=yes')->html($d);
         } else {
             if ($o == 'console') {
                 C()->evaluate('(window.console)? window.console.log("' . Raxan::escapeText($d) . '"):""');
             } else {
                 if ($o == 'embedded') {
                     if ($this->isAjaxRequest) {
                         C('#rxPDI_Debug')->remove();
                     }
                     // remove if in callback
                     C('body')->append('<div id="rxPDI_Debug" style="padding:5px;border:3px solid #ccc;background:#fff"></div>');
                     C('#rxPDI_Debug')->html($d);
                 }
             }
         }
     }
     return $this;
 }