-
Notifications
You must be signed in to change notification settings - Fork 355
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
Adds adapter for Google Cloud Client Library #427
base: master
Are you sure you want to change the base?
Conversation
…rary 0.8.0) - general cleanup - added extra unit tests
…rary 0.8.0) - general cleanup - added extra unit tests
Hello @PanzerLlama, What's the difference with the current |
Hi @NiR- , Google Cloud Client Library is just an alternative to GCS PHP API lib. Quote from the homepage (https://googlecloudplatform.github.io/google-cloud-php/#/): "What is the relationship between the Google Cloud Client Library and the Google APIs PHP Client? [...] The Google Cloud Client Library is built specifically for the Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your PHP applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used by your application." Personally I found the documentation for GCCL to be clearer and easier to work with, also this lib is actively developed by Google programmers contrary to the GCS which is generated automatically. In a nutshell - Google recommends GCCL if the app is developed in single language (PHP). More details on the differences can be found here: https://cloud.google.com/storage/docs/json_api/v1/libraries |
@PanzerLlama Could you update the existing adapter rather than creating a new one? |
@NiR- - not sure if this works out well since these are 2 different libraries sitting on top of the Google Cloud API so adding support to the existing adapter would generate a lot of extra code in it. Also the constructor of the existing adapter requires \Google_Service_Storage and my adapter uses \Google\Cloud\Storage\StorageClient so looks like merging will create BC break. (?) I think since these are 2 different libraries it feels right to have 2 different adapters. edit sometime later: ok, the BC break note is not true. I think I don't get the pros of merging these 2 into one adapter but if you think it's vital I will come into line :) (won't be that quick though). |
composer.json
Outdated
@@ -38,7 +38,8 @@ | |||
"phpunit/phpunit": "3.7.*", | |||
"microsoft/windowsazure": "dev-master", | |||
"mikey179/vfsStream": "~1.2.0", | |||
"league/flysystem": "~1.0" | |||
"league/flysystem": "~1.0", | |||
"google/cloud": ">=0.20.1" |
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.
This dep should be added in the suggest section, because there is no need to install this library if you don't need to use your GoogleCloud adapter.
We opened an RFC to find a better solution to this problematic #466
One more point: shouldn't we require 'google/cloud-storage'
instead of the entire 'google/cloud'
library (as it's recommended here https://github.com/GoogleCloudPlatform/google-cloud-php/tree/master/src/Storage in the README.md section) ?
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.
Agreed & fixed.
Hi @PanzerLlama Sorry for not responding for a long time but we currently having a big internal discussion about the future of Gaufrette (see #466 and #464). The main idea for now is to split adapters into meta-packages and limit the amount of adapters we have to maintain. At the moment we already have a By the way, your implementation seems cool and it would be a waste to simply throw it away. So I see two solutions:
|
@PanzerLlama Indeed, seems to be a bad idea to reuse the current Adapter. @AntoineLelaisant I would go for the first option, but without even waiting the v1.0 release. If we want to deprecate the old adapter in the v0.4 release we need this new adapter to be available. |
Hi @AntoineLelaisant - let's do what you think is best. I'll be away now for around a week but will follow the feedback. |
{ | ||
$this->isBucket(); | ||
$object = $this->bucket->object($this->computePath($key)); | ||
$object->delete(); |
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.
Same question as previous comment.
|
||
$object = $this->bucket->object($this->computePath($key)); | ||
|
||
$properties = array_replace_recursive( |
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.
Why replace_recursive
? A simple array_replace
should do the work, no?
* | ||
* @author Lech Buszczynski <[email protected]> | ||
*/ | ||
interface ResourcesSupporter |
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.
I'm not sure about this one? What's the purpose of such interface?
@NiR- Will do the fixes sometime next week. Thanks for the feedback. |
It should be re-added when KnpLabs#427 is merged.
@PanzerLlama Is it ready to be merged? |
@NiR- yes, done all requested changed (may improve docs later but for now I am done) |
Can't wait for this adapter to be merged. 👍 Thanks for the hard work. |
Hi! Any update on this? Would be great if we could get this merged in. 👍 |
Conflicts: phpunit.xml.dist
@NiR- I am not sure why this still is labelled "needs rework" - I am happy to do changes but as far as I can see I did the updates that were requested. |
For anyone who wants to use this adapter (workaround):
You can also copy the test but its not required. I use this adapter for well over a year w/o issues. |
It should be re-added when KnpLabs#427 is merged.
It should be re-added when KnpLabs#427 is merged.
Hi,
Adapter for http://googlecloudplatform.github.io/google-cloud-php/
This change is