function do_method($a, $v = null)
 {
     $p = $this->target ? $this->target : $this;
     $args = optimize_args(func_get_args());
     /*get callback*/
     foreach ($args as $z) {
         if (ispack($z) && type($z) == 'object') {
             $cb = $z;
         }
     }
     $methods = $this->methods($p);
     if (isStr($a)) {
         if (isIn($a, $methods)) {
             $p->{$a}($v);
         } else {
             if (isset($cb)) {
                 $cb($p, array($a, $v));
             } else {
                 $p->attr($a, $v);
             }
         }
     } else {
         while (list($i, $v_) = _each($args, $k)) {
             if (isStr($i)) {
                 $this->do_method($i, $v_);
             }
             if (isDrw(OBJ($v_))) {
                 foreach ($v_ as $l => $v1) {
                     $this->do_method($l, $v1);
                 }
             }
         }
     }
     return $this;
 }
 function __call($n, $arg)
 {
     if (isset($this->O->{$n}) || ispack($this->O->{$n})) {
         return !count($args) ? $this->dom->{$n} : $this->dom->{$n}($args);
     }
     return $this;
 }
 function query($sql, $calback = null)
 {
     $this->result = mysql_query($sql, self::$con);
     $this->show_error();
     if (ispack($calback)) {
         $calback($this->result);
     }
     return $this;
 }
 function __call($f, $args)
 {
     $c = $this->methods;
     if (ispack($c)) {
         $c($this, $f, $args, $this->O);
     }
     if (isset($this->O->{$f})) {
         return !count($args) ? $this->O->{$f} : $this->O->{$f}($args);
     }
     return $this;
 }
 function eof($calback = null)
 {
     if (!$this->file) {
         return false;
     }
     if (ispack($calback)) {
         while (!feof($this->file)) {
             $calback($this);
         }
     } else {
         return feof($this->file);
     }
 }