Example #1
0
 /**
  * {@inheritdoc}
  */
 public function persist(File $file) : bool
 {
     // only write temporary, i.e. not yet persisted files, to backend file storage
     if ($file->isTmpFile()) {
         // use streams for writing to backend file storage
         $stream = fopen($file->getTmpPathname(), 'r+');
         return $this->filesystem->writeStream($file->getKey(), $stream);
     }
     return true;
 }