-
Notifications
You must be signed in to change notification settings - Fork 17
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
How Can I set Google Client options with this package? #5
Comments
Yep. Agreed. I think the app-local tmp path should suffice - would you care to contribute a pull request? |
Reviewing the
On the long run it might be useful to implement some of the caching logic and set it dynamically to the most useful available cache backend. What do you think? |
Forgive me I've never contributed on github before but I will make an attempt :) As far as your other comment, I think it should be an option on the driver config, perhaps 'cache_path' and default it to storage_path('framework/cache') or override via .env GCS_CACHE_PATH ? |
Exactly what I meant - maybe with the addition of GCS_CACHE_TYPE defaulting to 'file', resulting in Google_Cache_File instantiated. I'll happily review your contribution - no worries about that :) |
I'm not a fan of file caching. It won't solve wammy21's permission problems either since Google_Client will continue setting very restrictive permissions. Would it not be better to make everything about the Google_Client configurable so we can choose our own cache type? |
What about simply wrapping the instance into the native flysystem cache decorator? |
I think that's another kind of caching. The CachedAdapter seems to cache calls between the Flysystem adapter and the user; it is not a generic cache implementation that you can inject into the Google_Client itself. This issue is about configuring the Google_Client which requires a cache implementation adhering to their own interface so they can store auth tokens. |
@cedricziel I have finally been able to get around to doing this - please see pull request. |
I am having a problem with my server, I am running different laravel installs on one machine, but it seems they all want to use /tmp/Google_Client/ and it has now become an issue since the different sites run under different users.
Anyway the fix to what I am encountering is this:
http://stackoverflow.com/questions/17282894/a-client-error-occurred-could-not-create-storage-directory-tmp-google-client
Which is really just a matter of doing this:
$config = new Google_Config();
$config->setClassConfig('Google_Cache_File', array('directory' => '../tmp/cache'));
$client = new Google_Client($config);
Maybe add an option to set it via the config file or the .env?
The text was updated successfully, but these errors were encountered: