Example #1
0
 /**
  * Write contents to a file. Returns <em>false</em> on error (e.a. if file is a directory).
  *
  * @param string $content
  *
  * @return bool
  */
 public function setContentsOf($file, $content)
 {
     if ($file->exists() && !$file->isFile()) {
         return false;
     }
     $tempFS = FS::getSystemTemporaryFilesystem();
     $tempFile = $tempFS->createTempFile('ftp_');
     $tempFile->setContents($content);
     return $this->ftpPut($this, $tempFile);
 }