title: "file_get_contents()" returns only the first chunk (WebDAV)
body: <p>I'm a student, new to PHP (and web development in general), and am trying to write a simple interface with my college's WebDAV server.</p>
  
  <p>The following code (with appropriate credentials and address), which uses an HTTP WebDAV Client plugin I found (<a href="https://github.com/pear/HTTP_WebDAV_Client" rel="nofollow">https://github.com/pear/HTTP_WebDAV_Client</a>), successfully returns the first 8k of data from the .txt/.html/.js files I've tried it with, but no more.</p>
  
  <p>From what I can tell, the likely culprit is that the server is using chunked transfer encoding (which makes sense), which leads me to believe I will have to read in a stream of data, rather than a single file/chunk (again, I'm new to this). If so, I'm not certain of how to accomplish this.</p>
  
  <p>My understanding is that cURL would likely be the fastest way to do this, but I don't think Dreamhost has cURL enabled for php.</p>
  
  <pre><code>//this loads the HTTP_WebDAV_Client plugin:
  //  https://github.com/pear/HTTP_WebDAV_Client
  require_once "HTTP/WebDAV/Client.php";
  
      //this is for testing purposes only (for obvious reasons)
      $user = $_GET['user'];
      $pass = $_GET['pass'];
      $fileName = $_GET['fileName'];
  
      //actual address obscured
      $dir = "webdavs://" . $user . ":" . $pass . "@webfs.xxx.com/main/hcwebdav/";
  
      $file = fopen($dir.$fileName, "rb");
      //$content;
  
      if (!$file) {
  
          die("Error opening file :( $user $pass");
  
      } else {
          //This returns only the first chunk:
          echo file_get_contents($dir.$fileName);
  
          //this has the same behavior
          /*
          while ($line = fread($file, 8192)) {
              $content .= $line;
          }
          echo $content;
  
          fclose($file);
          */
  
      }
  </code></pre>
  
  <p>I hope this question isn't too stupid :/ I'm trying to write web applications to help intro-level students learn to code, and this plug-in would make it very easy for them to publish their own websites from a browser-based code editor/mini-IDE!</p>
  
  <p>Cheers!</p>