示例#1
0
 function dump($varVal, $isExit = FALSE, $linestack = 0)
 {
     if (config('app')[Constants::DEBUG]) {
         $debuginfo = debug_backtrace();
         $debuginfo = $debuginfo[$linestack];
         echo $debuginfo["file"] . ":" . $debuginfo['line'] . '<br>';
         if (self::RICH_HTML) {
             util::var_dump($varVal, false, -1);
         } else {
             ob_start();
             var_dump($varVal);
             $varVal = ob_get_clean();
             $varVal = preg_replace("/\\]\\=\\>\n(\\s+)/m", "] => ", $varVal);
             echo '<pre>' . $varVal . '</pre>';
         }
         $isExit && exit;
     }
 }
                        <b>Invalid format:</b><br>
                        <ul>
                        <?php 
        foreach ($d->getDecodingExceptions() as $e) {
            echo '<li>' . $e->getMessage();
            echo ', on chunk "' . $e->getChunk() . '"</li>';
        }
        $d->resetDecodingExceptions();
        ?>
                        </ul>
                    </div>
                <?php 
    }
    ?>
                <div><?php 
    $raw_dump = util::var_dump($d, true, 2);
    $to_delete = array('private:MetarDecoder\\Entity\\DecodedMetar:', 'private:MetarDecoder\\Entity\\', 'MetarDecoder\\Entity\\', 'Value:');
    $clean_dump = str_replace($to_delete, '', $raw_dump);
    echo $clean_dump;
    ?>
</div>
            </div>
            <?php 
} else {
    ?>
            </div>
                <br>
                <div class="alert alert-info">
                Need inspiration ? What about:
                <ul>
                    <li><a href="./index.php?metar=CYFB+271515Z+32017KT+3SM+DRSN+BKN040+M29%2FM34+A2957+RMK+SC7+SLP019">CYFB 271515Z 32017KT 3SM DRSN BKN040 M29/M34 A2957 RMK SC7 SLP019</a></li>
示例#3
0
 public function test_var_dump()
 {
     $input = 'var';
     $expect = '<pre style="margin-bottom: 18px;background: #f7f7f9;border: 1px solid #e1e1e8;padding: 8px;border-radius: 4px;-moz-border-radius: 4px;-webkit-border radius: 4px;display: block;font-size: 12.05px;white-space: pre-wrap;word-wrap: break-word;color: #333;font-family: Menlo,Monaco,Consolas,\'Courier New\',monospace;"><span style="color:#588bff;">string</span><span style="color:#999;">(</span>3<span style="color:#999;">)</span> <strong>"var"</strong></pre>';
     // Ensure the proper output is returned
     $this->assertEquals($expect, Util::var_dump($input, true));
     // Ensure the proper output is actually outputted
     $this->expectOutputString($expect);
     util::var_dump($input);
     // Ensure we avoid infinite recursion on recursive arrays
     $a = array('a' => 'value a', 'b' => 'value b');
     $b = array('test' => &$a);
     $c = array('a' => &$a, 'b' => &$b);
     $a['c'] =& $c;
     $b['c'] =& $c;
     $this->assertContains('*RECURSION DETECTED*', Util::var_dump($c, true));
     // Ensure we avoid infinite recursion on recursive objects
     $a = (object) array('a' => 'value a', 'b' => 'value b');
     $b = (object) array('test' => &$a);
     $c = (object) array('a' => &$a, 'b' => &$b);
     $a->c =& $c;
     $b->c =& $c;
     $this->assertContains('*RECURSION DETECTED*', Util::var_dump($c, true));
     // Test class scoping.
     $experiment = new VarDumpExperiment();
     $actual = util::var_dump($experiment, true);
     $snippet = substr($actual, strrpos($actual, 'display:inline'));
     $this->assertContains('"public"', $snippet);
     $this->assertContains('"protected:protected"', $snippet);
     $this->assertContains('"private:VarDumpExperiment:private"', $actual);
 }
示例#4
0
    // $output = json_decode ( gzuncompress ( base64_decode ( $data ) ) );
    $returnmessages = \hellaEngine\Supports\Common\Util\CommonUtilMessage::decodeMessage($output);
    // _dump ( $returnmessages );
    foreach ($returnmessages as $value) {
        // _dump ( $value );
        $command = \hellaEngine\Supports\Common\Util\CommonUtilMessage::Message_getCommand($value);
        // _dump ( $command );
        util::var_dump($command, false, -1);
    }
    // _dump ( $_SERVER );
    echo "<<<<<<<<<<<<<<<<<<<<<< function return <<<<<<<<<<<<<<<<<<<<<<<br>";
    // echo (">>>>return messagelenSRC:" . strlen ( $uncompressString ) . "<br>");
    echo ">>>>return messagelenQQ:" . strlen($output) . "<br>";
    echo ">>>>return message:" . $output . "<br>";
    if (C(configure_constants::DEBUG_DB)) {
        echo ">>>>>>>>>>>>>>>>>>>>>>>dbinfo>>>>>>>>>>>>>>>>>>>>>>><br>";
        if (isset($GLOBALS[configure_constants::DEBUG_DB_DIRTY_KEY])) {
            $debugdbarray = $GLOBALS[configure_constants::DEBUG_DB_DIRTY_KEY];
            if (!is_null($debugdbarray)) {
                // _dump ( $debugdbarray );
                util::var_dump($debugdbarray, false, -1);
            }
        }
    }
} else {
    echo $_GET['backurl'];
    $url = "Location:" . $_GET['backurl'];
    header($url);
    exit;
    // echo "here";
}
示例#5
0
function d($v)
{
    \utilphp\util::var_dump($v);
}