readfileChunked() public static method

Reads file chunk-by-chunk
public static readfileChunked ( string $path, callable $cb, callable $chunkcb, integer $pri = EIO_PRI_DEFAULT ) : resource
$path string Path
$cb callable Callback (Path, Success)
$chunkcb callable Chunk callback (Path, Chunk)
$pri integer Priority
return resource
Beispiel #1
0
 /**
  * Read request body from the file given in REQUEST_BODY_FILE parameter
  * @return boolean Success
  */
 public function readBodyFile()
 {
     if (!isset($this->attrs->server['REQUEST_BODY_FILE'])) {
         return false;
     }
     FileSystem::readfileChunked($this->attrs->server['REQUEST_BODY_FILE'], function ($file, $success) {
         $this->attrs->inputDone = true;
         if ($this->sleepTime === 0) {
             $this->wakeup();
         }
     }, function ($file, $chunk) {
         // readed chunk
         $this->stdin($chunk);
     });
     return true;
 }