1 | <?php |
||
2 | |||
3 | $google = null; |
||
4 | |||
5 | function google($offline = true) |
||
6 | { |
||
7 | global $google; |
||
8 | if (!$google) { |
||
9 | $google = new Google\client(); |
||
10 | $google->setApplicationName('Client_Library_Examples'); |
||
11 | $google->setDeveloperKey(CONFIG['google']['key']); |
||
12 | $google->setClientId(CONFIG['google']['client']); |
||
13 | $google->setClientSecret(CONFIG['google']['secret']); |
||
14 | $google->set_offline($offline) |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
15 | ->set_scope([ |
||
16 | 'https://www.googleapis.com/auth/youtube.readonly', |
||
17 | 'https://www.googleapis.com/auth/userinfo.email', |
||
18 | 'https://www.googleapis.com/auth/userinfo.profile', |
||
19 | 'https://www.googleapis.com/auth/drive', |
||
20 | 'https://www.googleapis.com/auth/youtube.force-ssl', |
||
21 | ]) |
||
22 | ->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/google/callback'); |
||
23 | } |
||
24 | return $google; |
||
25 | } |
||
26 |