You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Licensed under the Apache License, Version 2.0 (the "License");
6
+
* you may not use this file except in compliance with the License.
7
+
* You may obtain a copy of the License at
8
+
*
9
+
* http://www.apache.org/licenses/LICENSE-2.0
10
+
*
11
+
* Unless required by applicable law or agreed to in writing, software
12
+
* distributed under the License is distributed on an "AS IS" BASIS,
13
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+
* See the License for the specific language governing permissions and
15
+
* limitations under the License.
16
+
*/
17
+
18
+
namespaceGoogleApi;
19
+
20
+
/**
21
+
* This class stores all the configuration information that is needed for running an GoogleApi/Client.
22
+
* Since this project was shifted to PSR-0 standard, Its required to stop using "global" and use an OO method.
23
+
*
24
+
* @author Asaf David <asafdav@gmail.com>
25
+
*
26
+
*/
27
+
class Config {
28
+
protectedstatic$apiConfig = array();
29
+
30
+
/**
31
+
* Initializes $apiConfig,
32
+
* Php can't parse non-trivial expressions in data-members initializers, therefore a workaround is needed.
33
+
* This method will be called to initialize $apiConfig with the default values.
34
+
*
35
+
* @static
36
+
*/
37
+
staticfunctioninit() {
38
+
self::$apiConfig = array(
39
+
// True if objects should be returned by the service classes.
40
+
// False if associative arrays should be returned (default behavior).
41
+
'use_objects' => false,
42
+
43
+
// The application_name is included in the User-Agent HTTP header.
44
+
'application_name' => '',
45
+
46
+
// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
47
+
'oauth2_client_id' => '',
48
+
'oauth2_client_secret' => '',
49
+
'oauth2_redirect_uri' => '',
50
+
51
+
// The developer key, you get this at https://code.google.com/apis/console
52
+
'developer_key' => '',
53
+
54
+
// OAuth1 Settings.
55
+
// If you're using the apiOAuth auth class, it will use these values for the oauth consumer key and secret.
56
+
// See http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html for info on how to obtain those
57
+
'oauth_consumer_key' => 'anonymous',
58
+
'oauth_consumer_secret' => 'anonymous',
59
+
60
+
// Site name to show in the Google's OAuth 1 authentication screen.
61
+
'site_name' => 'www.example.org',
62
+
63
+
// Which Authentication, Storage and HTTP IO classes to use.
64
+
'authClass' => 'GoogleApi\Auth\OAuth2',
65
+
'ioClass' => 'GoogleApi\Io\CurlIO',
66
+
'cacheClass' => 'GoogleApi\Cache\FileCache',
67
+
68
+
// If you want to run the test suite (by running # phpunit AllTests.php in the tests/ directory), fill in the settings below
69
+
'oauth_test_token' => '', // the oauth access token to use (which you can get by runing authenticate() as the test user and copying the token value), ie '{"key":"foo","secret":"bar","callback_url":null}'
70
+
'oauth_test_user' => '', // and the user ID to use, this can either be a vanity name 'testuser' or a numberic ID '123456'
71
+
72
+
// Don't change these unless you're working against a special development or testing environment.
73
+
'basePath' => 'https://www.googleapis.com',
74
+
75
+
// IO Class dependent configuration, you only have to configure the values for the class that was configured as the ioClass above
76
+
'ioFileCache_directory' =>
77
+
(function_exists('sys_get_temp_dir') ?
78
+
sys_get_temp_dir() . '/apiClient' :
79
+
'/tmp/apiClient'),
80
+
'ioMemCacheStorage_host' => '127.0.0.1',
81
+
'ioMemcacheStorage_port' => '11211',
82
+
83
+
// Definition of service specific values like scopes, oauth token URLs, etc
0 commit comments