Compare commits

..

7 commits

Author SHA1 Message Date
David Wakelin
6b0f8f5e03 Added deprecation notice 2023-12-15 11:07:08 +00:00
David Wakelin
8ac092ea96 Version bump from bugfix 2023-12-15 11:06:58 +00:00
Aleksandar Kolakov
4f4b6148d2 Fixed hardcoded region in Spaces constructor 2023-12-15 10:30:35 +00:00
David Wakelin
6bc100cf90 Added move example to readme 2023-02-01 11:19:59 +00:00
David Wakelin
c52d22a70e Allowed passing validation flag to Space::file() 2022-11-11 09:55:47 +00:00
dependabot[bot]
3a32727c28 Bump guzzlehttp/guzzle from 7.4.3 to 7.4.5
Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.3 to 7.4.5.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md)
- [Commits](https://github.com/guzzle/guzzle/compare/7.4.3...7.4.5)

---
updated-dependencies:
- dependency-name: guzzlehttp/guzzle
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 22:02:32 +01:00
dependabot[bot]
e9cdacc684 Bump guzzlehttp/guzzle from 7.4.2 to 7.4.3
Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.2 to 7.4.3.
- [Release notes](https://github.com/guzzle/guzzle/releases)
- [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md)
- [Commits](https://github.com/guzzle/guzzle/compare/7.4.2...7.4.3)

---
updated-dependencies:
- dependency-name: guzzlehttp/guzzle
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-26 07:30:22 +01:00
6 changed files with 206 additions and 243 deletions

View file

@ -1,6 +1,7 @@
![Spaces-API](https://imgur.com/NYNsQyl.png "Devang Srivastava's Spaces-API")
# This library is deprecated
We recommend using the [official SDK](https://github.com/DigitalOceanPHP/Client) or the [Laravel package](https://github.com/GrahamCampbell/Laravel-DigitalOcean)
PHP library for accessing Digital Ocean spaces
All issues will be closed and new PRs will not be accepted
## Installation
Install via composer
@ -32,6 +33,9 @@ $file2url = $file2->getSignedURL("2 hours");
// Make a copy
$file3 = $file2->copy('remote-file-3.txt');
// Move or rename a file
$file2->move('new-filename.txt')
// Make a file public and get the URL
$file3->makePublic();
$file3url = $file3->getURL();

View file

@ -325,13 +325,14 @@ class Space
* Get an instance of \SpacesAPI\File for a given filename
*
* @param string $filename
* @package bool $validate
*
* @return \SpacesAPI\File
* @throws \SpacesAPI\Exceptions\FileDoesntExistException Thrown if the file doesn't exist
*/
public function file(string $filename): File
public function file(string $filename, bool $validate = true): File
{
return new File($this, $filename);
return new File($this, $filename, [], $validate);
}
/**

View file

@ -36,7 +36,7 @@ class Spaces
{
$this->s3 = new S3Client([
"version" => "latest",
"region" => "us-east-1",
"region" => $region,
"endpoint" => "https://$region.$host",
"credentials" => ["key" => $accessKey, "secret" => $secretKey],
"ua_append" => "SociallyDev-Spaces-API/2",

View file

@ -1,7 +1,7 @@
{
"name": "sociallydev/spaces-api",
"description": "Library for accessing Digital Ocean spaces",
"version":"3.5.0",
"version":"3.6.1",
"type": "library",
"license": "MIT",
"authors": [

428
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -180,7 +180,7 @@ Recursively download an entire directory.
**Description**
```php
public file (string $filename)
public file (string $filename, bool $validate = true)
```
Get an instance of \SpacesAPI\File for a given filename
@ -190,6 +190,8 @@ Get an instance of \SpacesAPI\File for a given filename
**Parameters**
* `(string) $filename`
* `(bool) $validate`
: Whether to validate the file exits. Defaults to `true`
**Return Values**