/** * Copy a transform for a file from source location to target location. * * @param AssetFileModel $file * @param $source * @param $target * @return mixed */ public function copyTransform(AssetFileModel $file, $source, $target) { $this->_prepareForRequests(); $basePath = $this->_getPathPrefix() . $file->getFolder()->fullPath; $bucket = $this->getSettings()->bucket; @$this->_googleCloud->copyObject($bucket, $basePath . $source . '/' . $file->filename, $bucket, $basePath . $target . '/' . $file->filename, \GC::ACL_PUBLIC_READ); }
/** * @inheritDoc BaseAssetSourceType::copySourceFile() * * @param $sourceUri * @param $targetUri * * @return bool */ protected function copySourceFile($sourceUri, $targetUri) { if ($sourceUri == $targetUri) { return true; } $bucket = $this->getSettings()->bucket; return (bool) @$this->_googleCloud->copyObject($bucket, $sourceUri, $bucket, $targetUri, \GC::ACL_PUBLIC_READ); }