-
Notifications
You must be signed in to change notification settings - Fork 357
Adds adapter for Google Cloud Client Library #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PanzerLlama
wants to merge
25
commits into
KnpLabs:master
Choose a base branch
from
PanzerLlama:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d9cca50
f6520fe
d7ec673
8060ad6
759b856
c0de2c7
- added functional "rename" (now supported by Google Cloud Client Lib…
PanzerLlama d1e31ef
- added functional "rename" (now supported by Google Cloud Client Lib…
PanzerLlama 342b015
924a41f
- fix for reading metadata from GCP files
PanzerLlama 294abce
- fix for reading metadata from GCP files
PanzerLlama dcd7f08
Merge origin/master
PanzerLlama 30fd12e
Merge origin/master
PanzerLlama e4bec1b
Merge origin/master
PanzerLlama 743d1ed
Merge origin/master
PanzerLlama 5e20eac
Merge branch 'master' into master
PanzerLlama 348a3f6
Merged master fixed conflicts
PanzerLlama b72f6b9
Fixed merges
PanzerLlama a12adfa
Fixed merges
PanzerLlama 58da147
Work in progress for requested changes
PanzerLlama 13cfbca
Requested changes fixes
PanzerLlama e5eb7af
Requested changes fixes
PanzerLlama f46731f
Merge branch 'master' into master
PanzerLlama c465752
Fixed composer.json
PanzerLlama f86eb53
clean-up
PanzerLlama e4d4825
Merge remote-tracking branch 'upstream/master'
PanzerLlama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
currentMenu: google-cloud-client-storage | ||
--- | ||
|
||
# Google Cloud Client Storage | ||
|
||
This adapter requires an instance of Google\Cloud\Storage\StorageClient that has proper access rights to the bucket you want to use. | ||
|
||
For more details see: | ||
http://googlecloudplatform.github.io/google-cloud-php/ | ||
https://console.cloud.google.com/ | ||
|
||
## Example | ||
|
||
```php | ||
<?php | ||
|
||
use Gaufrette\Filesystem; | ||
use Gaufrette\Adapter\GoogleCloudClientStorage; | ||
|
||
$storage = new StorageClient(array( | ||
'projectId' => 'your-project-id', | ||
'keyFilePath' => 'path/to/your/project/key.json' | ||
)); | ||
|
||
# you can optionally set the directory in the bucket and the acl permissions for all uploaded files... | ||
# by default the uploaded files are read/write by the owner only | ||
# the example below gives read access to the uploaded files to anyone in the world | ||
|
||
$adapter = new GoogleCloudClientStorage($storage, 'bucket_name', | ||
array( | ||
'directory' => 'bucket_directory', | ||
'acl' => array( | ||
'allUsers' => \Google\Cloud\Storage\Acl::ROLE_READER | ||
) | ||
) | ||
); | ||
|
||
$key = 'myAmazingFile.txt'; | ||
|
||
# optional | ||
$adapter->setMetadata($key, | ||
array( | ||
'FileDescription' => 'This is my file. There are many like it, but this one is mine.' | ||
) | ||
); | ||
|
||
$filesystem = new Filesystem($adapter); | ||
|
||
$filesystem->write($key, 'Uploaded at: '.date('Y-m-d @ H:i:s'), true); | ||
|
||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have any idea what's the minimum set of security access (roles?) needed to use it? Would be awesome to provide something equivalent to this. But that's a detail, it could be postpone to another PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
google/cloud-storage
v1.0 has been released a month ago. Do you think your work is compatible with it? Would be great to depend on a stable branch rather thandev-master
;)