Exemple #1
0
 public function toDebug()
 {
     $exprStrings = array();
     foreach ($this->_expressions as $expr) {
         $exprStrings[] = trim(_pArray($expr, '    '));
     }
     return '(' . implode(")\n    OR (", $exprStrings) . ')';
 }
 public function toDebug()
 {
     $out = '';
     foreach ($this->_parts as $type => $p) {
         if (is_array($p)) {
             $out .= "\n";
             $out .= "{$type} => array(\n";
             foreach ($p as $k => $i) {
                 $out .= '    ';
                 if ($i instanceof Kwf_Model_Select_Expr_Interface) {
                     if (!is_int($k)) {
                         $out .= $k . ' => ';
                     }
                     $out .= _pArray($i, '    ');
                 } else {
                     $out .= $k . ' => ' . Kwf_Debug::_btArgString($i);
                 }
                 $out .= ",\n";
             }
             $out .= "),\n";
         } else {
             $out .= "\n";
             $out .= "{$type} => " . Kwf_Debug::_btArgString($p) . ", ";
         }
     }
     $out = trim($out, ', ');
     $ret = '<pre>' . get_class($this) . '(' . $out . "\n)</pre>";
     return $ret;
 }
Exemple #3
0
/**
 * @internal
 */
function _pArray($src, $indent = '')
{
    $ret = '';
    if (is_array($src)) {
        $ret .= "{$indent}array " . count($src) . " entries (\n";
        foreach ($src as $k => $i) {
            $ret .= $indent . "{$k} =>\n";
            $ret .= _pArray($i, $indent . '  ');
        }
        $ret .= "{$indent})\n";
    } else {
        if (is_object($src) && method_exists($src, 'toDebug')) {
            $src = $src->toDebug();
            $src = str_replace('<pre>', '', $src);
            $src = str_replace('</pre>', '', $src);
        } else {
            if (is_object($src) && method_exists($src, '__toString')) {
                $src = $src->__toString();
            } else {
                if (!is_string($src)) {
                    $src = print_r($src, true);
                } else {
                    if (strlen($src) > 400) {
                        $src = substr($src, 0, 400) . "..." . ' (length=' . strlen($src) . ')';
                    }
                }
            }
        }
        foreach (explode("\n", $src) as $l) {
            $ret .= $indent . $l . "\n";
        }
    }
    return $ret;
}
 public function toDebug()
 {
     return trim(_pArray($this->_field)) . ' CONTAINS \'' . trim(_pArray($this->_value)) . '\'';
 }