Skip to content

Commit

Permalink
Added privacy setting to text upload
Browse files Browse the repository at this point in the history
  • Loading branch information
David Wakelin committed Oct 4, 2021
1 parent 8ff8498 commit 7c91582
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 92 deletions.
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ body:
id: version
attributes:
label: Version
description: What version of Spaces-API is this occuring on?
description: What version of Spaces-API is this occuring on? Versions below 3 will not be fixed. Please upgrade.
options:
- 2.0.1
- 2.0.0
- 3.2.0
- 3.1.0
- 3.0.0
validations:
required: true
- type: input
Expand Down
5 changes: 3 additions & 2 deletions SpacesAPI/Space.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@ private function rawListFiles(string $directory = "", ?string $continuationToken
* @param string $text The text to upload
* @param string $filename The filepath/name to save to
* @param array $params Any extra parameters. [See here](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property)
* @param bool $private True for the file to be private, false to allow public access
*
* @return \SpacesAPI\File
*/
public function uploadText(string $text, string $filename, array $params = []): File
public function uploadText(string $text, string $filename, array $params = [], bool $private = true): File
{
$this->s3->upload($this->name, $filename, $text, 'private', $params);
$this->s3->upload($this->name, $filename, $text, ($private) ? 'private' : 'public-read', $params);
return new File($this, $filename, [], false);
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sociallydev/spaces-api",
"description": "Library for accessing Digital Ocean spaces",
"version":"3.2.0",
"version":"3.3.0",
"type": "library",
"license": "MIT",
"authors": [
Expand Down
Loading

0 comments on commit 7c91582

Please sign in to comment.