Exemple #1
0
 public static function arrayToString($arr)
 {
     $str = null;
     $prevKey = null;
     foreach ($arr as $key => $item) {
         if ($str) {
             $str = $str . ",";
         }
         if (is_array($item)) {
             if ($prevKey && $key == $prevKey) {
                 $str = $str . "," . KDLUtils::arrayToString($item);
             } else {
                 $str = $str . $key . "=>" . KDLUtils::arrayToString($item);
             }
         } else {
             if (!is_object($item)) {
                 // && )
                 $item2str = $item;
             } else {
                 if (method_exists($item, "ToString")) {
                     $item2str = $item->ToString();
                 } else {
                     $item2str = "item";
                 }
             }
             if ($prevKey && $key == $prevKey) {
                 $str = $str . "," . $item2str;
             } else {
                 $str = $str . $key . "=>" . $item2str;
             }
         }
         $prevkey = $key;
     }
     return $str;
 }
 public function ToString()
 {
     $rvStr = "flag({$this->_flags})";
     if ($this->_clipStart) {
         $rvStr .= ",clpStr({$this->_clipStart})";
     }
     if ($this->_clipDur) {
         $rvStr .= ",clpDur({$this->_clipDur})";
     }
     $rvStr .= "," . parent::ToString();
     if (count($this->_errors)) {
         $rvStr = $rvStr . ",ERRS(" . KDLUtils::arrayToString($this->_errors) . ")";
     }
     if (count($this->_warnings)) {
         $rvStr = $rvStr . ",WRNS(" . KDLUtils::arrayToString($this->_warnings) . ")";
     }
     if (count($this->_transcoders)) {
         $rvStr = $rvStr . ",TRNS(" . KDLUtils::arrayToString($this->_transcoders) . ")";
     }
     return $rvStr;
 }