/** * @param Client $client * @param mixed $source * @param array $config */ public function __construct(Client $client, $source, array $config = []) { $this->source = $this->determineSource($source); parent::__construct($client, $config); }
/** * Creates a multipart upload for copying an S3 object. * * The valid configuration options are as follows: * * - acl: (string) ACL to set on the object being upload. Objects are * private by default. * - before_complete: (callable) Callback to invoke before the * `CompleteMultipartUpload` operation. The callback should have a * function signature like `function (Aws\Command $command) {...}`. * - before_initiate: (callable) Callback to invoke before the * `CreateMultipartUpload` operation. The callback should have a function * signature like `function (Aws\Command $command) {...}`. * - before_upload: (callable) Callback to invoke before `UploadPartCopy` * operations. The callback should have a function signature like * `function (Aws\Command $command) {...}`. * - bucket: (string, required) Name of the bucket to which the object is * being uploaded. * - concurrency: (int, default=int(5)) Maximum number of concurrent * `UploadPart` operations allowed during the multipart upload. * - key: (string, required) Key to use for the object being uploaded. * - part_size: (int, default=int(5242880)) Part size, in bytes, to use when * doing a multipart upload. This must between 5 MB and 5 GB, inclusive. * - state: (Aws\Multipart\UploadState) An object that represents the state * of the multipart upload and that is used to resume a previous upload. * When this option is provided, the `bucket`, `key`, and `part_size` * options are ignored. * - source_metadata: (Aws\ResultInterface) An object that represents the * result of executing a HeadObject command on the copy source. * * @param S3ClientInterface $client Client used for the upload. * @param string $source Location of the data to be copied * (in the form /<bucket>/<key>). * @param array $config Configuration used to perform the upload. */ public function __construct(S3ClientInterface $client, $source, array $config = []) { $this->source = '/' . ltrim($source, '/'); parent::__construct($client, array_change_key_case($config) + ['source_metadata' => null]); }