Skip to content

Commit

Permalink
Use google/cloud-storage instead of the google/cloud omnibus package (#…
Browse files Browse the repository at this point in the history
…75)

* opt: using google/cloud-storage. close #74

* fixbug: there is no Google\Cloud\Exception but Google\Cloud\Core\Exception #74

* fixbug: ci should remove google cloud #74

* opt: support google/cloud-storage 1.0 #74

* fixbug: styleci bad link

* fixbug: variable name error

* safer: limit require version #74

* Bring back StyleCI #26
  • Loading branch information
sinkcup authored and zoidyzoidzoid committed Feb 7, 2018
1 parent 59aac00 commit be84763
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ php:
- nightly

env:
- GOOGLE_CLOUD="0.21.*"
- GOOGLE_CLOUD="0.43.*"
- GOOGLE_CLOUD_STORAGE="1.0.*"
- GOOGLE_CLOUD_STORAGE="1.1.*"
- GOOGLE_CLOUD_STORAGE="1.2.*"
- GOOGLE_CLOUD_STORAGE="1.3.*"
- RELEASE_TAG=1 # dev-master
- RELEASE_TAG=2 # latest-stable
- RELEASE_TAG=3 # previous-stable
Expand All @@ -26,12 +28,12 @@ before_install:
- bash -c 'if [[ "${TRAVIS_PHP_VERSION}" == "hhvm" ]]; then rm phpunit.xml; mv phpunit.hhvm.xml phpunit.xml; fi;'

install:
- if [[ -z "$GOOGLE_CLOUD" ]]; then GOOGLE_CLOUD=$(travis_retry composer show google/cloud -a | grep versions | cut -d "," -f ${RELEASE_TAG} | sed -e "s/^versions ://" | xargs); fi;
- travis_retry composer require --no-interaction --no-suggest "google/cloud:${GOOGLE_CLOUD}"
- if [[ -z "$GOOGLE_CLOUD_STORAGE" ]]; then GOOGLE_CLOUD_STORAGE=$(travis_retry composer show google/cloud-storage -a | grep versions | cut -d "," -f ${RELEASE_TAG} | sed -e "s/^versions ://" | xargs); fi;
- travis_retry composer require --no-interaction --no-suggest "google/cloud-storage:${GOOGLE_CLOUD_STORAGE}"
- travis_retry composer install --no-interaction --no-suggest

script:
- export GOOGLE_CLOUD=$GOOGLE_CLOUD
- export GOOGLE_CLOUD_STORAGE=$GOOGLE_CLOUD_STORAGE
- bin/phpunit

after_script:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ $adapter->setPathPrefix('extra-folder/another-folder/');
$filesystem = new Filesystem($adapter);
$filesystem->getUrl('path/to/file.txt');
// "http://example.com/extra-folder/another-folder/path/to/file.txt"
```
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": ">=5.5.0",
"league/flysystem": "~1.0",
"google/cloud": ">=0.21 <0.50"
"google/cloud-storage": ">=1.0 <1.4"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
Expand Down
5 changes: 1 addition & 4 deletions src/GoogleStorageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Superbalist\Flysystem\GoogleStorage;

use Google\Cloud\Exception\NotFoundException;
use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Storage\Acl;
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageClient;
Expand Down Expand Up @@ -425,9 +425,6 @@ protected function getRawVisibility($path)
} catch (NotFoundException $e) {
// object may not have an acl entry, so handle that gracefully
return AdapterInterface::VISIBILITY_PRIVATE;
} catch (\Google\Cloud\Core\Exception\NotFoundException $e) {
// no acl for modern cloud sdk
return AdapterInterface::VISIBILITY_PRIVATE;
}
}

Expand Down

0 comments on commit be84763

Please sign in to comment.