/**
  * Upload directory.
  * 
  * @param string $local_dir
  * @param string $remote_dir
  */
 public function putDir($local_dir, $remote_dir)
 {
     $entries = Dir::entries($local_dir);
     $this->_log("recursive directory upload {$local_dir} to {$remote_dir}\n");
     foreach ($entries as $entry) {
         if (Dir::exists($entry)) {
             $this->putDir($entry, $remote_dir . '/' . basename($entry));
         } else {
             if (File::exists($entry)) {
                 $this->put($entry, $remote_dir . '/' . basename($entry));
             }
         }
     }
 }
 /**
  * Return directory size (= sum of all filesizes in directory tree).
  *
  * @param string $path
  * @return int
  */
 public static function size($path)
 {
     $entries = Dir::entries($path);
     $size = 0;
     foreach ($entries as $entry) {
         if (FSEntry::isDir($entry, false)) {
             $size += Dir::size($entry);
         } else {
             if (FSEntry::isFile($entry, false)) {
                 $size += File::size($entry);
             }
         }
     }
     return $size;
 }