original_string: function mput($filelist) {
  
          $result = true;
  
          foreach ($filelist as $localpath => $destpath) {
  
              $localpath = rtrim($localpath, "/");
              $destpath  = rtrim($destpath, "/");
  
              // attempt to create target path
              if (is_dir($localpath)) {
                  $pathparts = explode("/", $destpath."/ "); // add one level, last level will be created as dir
              } else {
                  $pathparts = explode("/", $destpath);
              }
              $checkpath = "";
              for ($i=1; $i<sizeof($pathparts)-1; $i++) {
                  $checkpath .= "/" . $pathparts[$i];
                  if (!($this->is_dir($checkpath))) {
  
                      $result &= ($this->mkcol($checkpath) == 201 );
                  }
              }
  
              if ($result) {
                  // recurse directories
                  if (is_dir($localpath)) {
                      if (!$dp = opendir($localpath)) {
                          $this->_error_log("Could not open localpath for reading");
                          return false;
                      }
                      $fl = array();
                      while($filename = readdir($dp)) {
                          if ((is_file($localpath."/".$filename) || is_dir($localpath."/".$filename)) && $filename!="." && $filename != "..") {
                              $fl[$localpath."/".$filename] = $destpath."/".$filename;
                          }
                      }
                      $result &= $this->mput($fl);
                  } else {
                      $result &= ($this->put_file($destpath, $localpath) == 201);
                  }
              }
          }
          return $result;
      }
code: function mput($filelist) {
  
          $result = true;
  
          foreach ($filelist as $localpath => $destpath) {
  
              $localpath = rtrim($localpath, "/");
              $destpath  = rtrim($destpath, "/");
  
              // attempt to create target path
              if (is_dir($localpath)) {
                  $pathparts = explode("/", $destpath."/ "); // add one level, last level will be created as dir
              } else {
                  $pathparts = explode("/", $destpath);
              }
              $checkpath = "";
              for ($i=1; $i<sizeof($pathparts)-1; $i++) {
                  $checkpath .= "/" . $pathparts[$i];
                  if (!($this->is_dir($checkpath))) {
  
                      $result &= ($this->mkcol($checkpath) == 201 );
                  }
              }
  
              if ($result) {
                  // recurse directories
                  if (is_dir($localpath)) {
                      if (!$dp = opendir($localpath)) {
                          $this->_error_log("Could not open localpath for reading");
                          return false;
                      }
                      $fl = array();
                      while($filename = readdir($dp)) {
                          if ((is_file($localpath."/".$filename) || is_dir($localpath."/".$filename)) && $filename!="." && $filename != "..") {
                              $fl[$localpath."/".$filename] = $destpath."/".$filename;
                          }
                      }
                      $result &= $this->mput($fl);
                  } else {
                      $result &= ($this->put_file($destpath, $localpath) == 201);
                  }
              }
          }
          return $result;
      }
code_tokens: function mput ( $ filelist ) { $ result = true ; foreach ( $ filelist as $ localpath => $ destpath ) { $ localpath = rtrim ( $ localpath , "/" ) ; $ destpath = rtrim ( $ destpath , "/" ) ; // attempt to create target path if ( is_dir ( $ localpath ) ) { $ pathparts = explode ( "/" , $ destpath . "/ " ) ; // add one level, last level will be created as dir } else { $ pathparts = explode ( "/" , $ destpath ) ; } $ checkpath = "" ; for ( $ i = 1 ; $ i < sizeof ( $ pathparts ) - 1 ; $ i ++ ) { $ checkpath .= "/" . $ pathparts [ $ i ] ; if ( ! ( $ this -> is_dir ( $ checkpath ) ) ) { $ result &= ( $ this -> mkcol ( $ checkpath ) == 201 ) ; } } if ( $ result ) { // recurse directories if ( is_dir ( $ localpath ) ) { if ( ! $ dp = opendir ( $ localpath ) ) { $ this -> _error_log ( "Could not open localpath for reading" ) ; return false ; } $ fl = array ( ) ; while ( $ filename = readdir ( $ dp ) ) { if ( ( is_file ( $ localpath . "/" . $ filename ) || is_dir ( $ localpath . "/" . $ filename ) ) && $ filename != "." && $ filename != ".." ) { $ fl [ $ localpath . "/" . $ filename ] = $ destpath . "/" . $ filename ; } } $ result &= $ this -> mput ( $ fl ) ; } else { $ result &= ( $ this -> put_file ( $ destpath , $ localpath ) == 201 ) ; } } } return $ result ; }
docstring: Public method mput
  
  Puts multiple files and/or directories onto a webdav server.
  
  Filenames should be allready UTF-8 encoded.
  Param fileList must be in format array("localpath" => "destpath").
  
  @param array filelist
  @return bool true on success. otherwise int status code on error
docstring_tokens: Public method mput