Ejemplo n.º 1
0
 /**
  * @param $params
  */
 public function notify($params = array())
 {
     $order = $this->getOrder();
     $eventName = $this->getEvent()->getName();
     $message = $eventName . '  / ' . $this->getName();
     if ($order && $order->id) {
         $message .= ' (id:' . $order->id . ')';
     } else {
         if (!empty($order)) {
             $message .= ' (id:0)';
         } else {
             if (!empty($order)) {
                 $message .= ' (null)';
             }
         }
     }
     jbdump::log($message);
 }
Ejemplo n.º 2
0
            <?php 
} else {
    ?>

                <div class="errorinfo">
                    <pre><?php 
    echo htmlspecialchars($this->error->getMessage());
    ?>
</pre>
                    <?php 
    echo str_replace(JPATH_ROOT, '', $this->renderBacktrace());
    ?>
                    <?php 
    if (class_exists('jbdump')) {
        echo '<hr/>';
        jbdump::get();
        jbdump::post();
        jbdump::cookie();
        jbdump::session();
    }
    ?>
                </div>
            <?php 
}
?>
        </div>
    </div>

</body></html>
Ejemplo n.º 3
0
<?php

/**
 * @package     JBDump test
 * @version     1.2.0
 * @author      admin@joomla-book.ru
 * @link        http://joomla-book.ru/
 * @copyright   Copyright (c) 2009-2011 Joomla-book.ru
 * @license     GNU General Public License version 2 or later; see LICENSE
 * 
 */
include './included_file.php';
JBDump::showErrors();
?>
<h3>Code</h3><?php 
JBDump(file_get_contents(__FILE__), 0, '-= Code =-::source');
?>
<h3>Result</h3><?php 
echo '$jbdump = jbdump::i()->post()->get()->server();';
$jbdump = jbdump::i()->post()->get()->server();
echo 'jbdump::get();';
jbdump::get();
echo 'jbdump::post();';
jbdump::post();
echo 'jbdump::server();';
jbdump::server();
echo '$jbdump->get();';
$jbdump->get();
echo "jbdump()->dump('123')->get();";
jbdump()->dump('123')->get();
Ejemplo n.º 4
0
 /**
  * @param $method
  * @param $args
  */
 protected function _log($method, $args = array())
 {
     if (class_exists('jbdump')) {
         \jbdump::log(json_encode($args), 'SSM_SOAP:' . $method);
     }
 }
Ejemplo n.º 5
0
 /**
  * Test method func args
  */
 function testFuncArgs($a, $b, $c = 123456)
 {
     jbdump::args();
 }
Ejemplo n.º 6
0
<?php

/**
 * @package     JBDump test
 * @version     1.2.0
 * @author      admin@joomla-book.ru
 * @link        http://joomla-book.ru/
 * @copyright   Copyright (c) 2009-2011 Joomla-book.ru
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
include './included_file.php';
jbdump::mark('test::start');
JBDump::showErrors();
set_time_limit(10);
echo '<pre>';
echo $unknown_var;
jbdump::get();
jbdump::mark('test::finish');
$simpleObject = new simpleObject();
$simpleObject->getException();
echo '</pre>';
Ejemplo n.º 7
0
 /**
  * Render explain table
  * Function ported from Joomla debug plugin
  * @param JBDatabaseQuery $select
  * @return null|string
  */
 protected function _explain(JBDatabaseQuery $select)
 {
     if (!(class_exists('jbdump') || JDEBUG)) {
         return null;
     }
     $table = $this->app->database->queryAssocList('EXPLAIN ' . $select->__toString());
     if (!$table) {
         return null;
     }
     $html = array();
     $html[] = '<table class="table" style="width:1600px"><tr>';
     foreach (array_keys($table[0]) as $k) {
         $html[] = '<th>' . htmlspecialchars($k) . '</th>';
     }
     $html[] = '</tr>';
     foreach ($table as $tr) {
         $html[] = '<tr>';
         foreach ($tr as $k => $td) {
             if ($td === null) {
                 $td = 'NULL';
             }
             if ($k == 'Error') {
                 $html[] = '<td class="dbg-warning">' . htmlspecialchars($td);
             } elseif ($k == 'key') {
                 if ($td === 'NULL') {
                     $html[] = '<td><strong style="color:#f00;">NO_INDEX</strong>';
                 } else {
                     $html[] = '<td><strong>' . htmlspecialchars($td) . '</strong>';
                 }
             } elseif ($k == 'Extra') {
                 $htmlTd = htmlspecialchars($td);
                 $htmlTd = preg_replace('/([^;]) /', '\\1&nbsp;', $htmlTd);
                 $htmlTdWithWarnings = str_replace('Using&nbsp;filesort', '<strong style="color:#f00;">USE_FILESORT</strong>', $htmlTd);
                 $html[] = '<td>' . $htmlTdWithWarnings;
             } elseif ($k == 'possible_keys') {
                 $td = str_replace(',', ",\n", $td);
                 $html[] = '<td>' . htmlspecialchars($td);
             } else {
                 $html[] = '<td>' . htmlspecialchars($td);
             }
             $html[] = '</td>';
         }
         $html[] = '</tr>';
     }
     $html[] = '</table>';
     $result = implode(PHP_EOL, $html);
     jbdump::sql($select);
     dump($result, 0, 'Explain::html');
 }