Esempio n. 1
0
 /**
  * @param Asset $asset
  * @return bool
  */
 public function saveAsset(Asset $asset)
 {
     if ($asset->getFile() !== null) {
         file_put_contents($this->basePath . "/" . $this->subDir . $asset->getPath() . $asset->getFilename(), file_get_contents($asset->getFile()->getRealPath()));
         $asset->setPath('/' . $this->subDir);
     }
     return true;
 }
Esempio n. 2
0
 /**
  * @param Asset $asset
  * @return ResultInterface
  */
 public function uploadAsset(Asset $asset)
 {
     $asset->setPath($this->basePath . "/");
     return $this->s3Client->upload($this->bucket, $asset->getPath() . $asset->getFilename(), file_get_contents($asset->getUploadedFile()->getRealPath()));
 }
Esempio n. 3
0
 /**
  * @param Asset $asset
  * @return bool
  */
 public function uploadAsset(Asset $asset)
 {
     $asset->getUploadedFile()->move($this->basePath . $asset->getPath(), $asset->getFilename());
     return true;
 }