示例#1
0
 /**
  * Return an S3Client object for a specific attachment type.
  * If no instance has been defined yet we'll buld one and then
  * cache it on the s3Clients property (for the current request only).
  *
  * @param  Expstudio\LaraClip\Attachment $attachedFile
  * @return SS3Client
  */
 public function getS3Client($attachedFile)
 {
     $modelName = $attachedFile->getInstanceClass();
     $attachmentName = $attachedFile->getConfig()->attachmentName;
     $key = "{$modelName}.{$attachmentName}";
     if (array_key_exists($key, $this->s3Clients)) {
         return $this->s3Clients[$key];
     }
     $this->s3Clients[$key] = $this->buildS3Client($attachedFile);
     return $this->s3Clients[$key];
 }
示例#2
0
 /**
  * Return the path (on disk) of a file upload.
  * 
  * @param  string $styleName 
  * @return string          
  */
 public function path($styleName)
 {
     return $this->attachedFile->getInterpolator()->interpolate($this->attachedFile->path, $this->attachedFile, $styleName);
 }