X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/platform/plugins/analytics/src
home
/
gfecatvj
/
sites
/
realesbar
/
platform
/
plugins
/
analytics
/
src
/
📁
..
📄
Analytics.php
(6.02 KB)
📄
AnalyticsClient.php
(2.43 KB)
📄
AnalyticsClientFactory.php
(2.06 KB)
📁
Cache
📁
Exceptions
📁
Facades
📄
GoogleClient.php
(1.84 KB)
📁
Http
📄
Period.php
(2.05 KB)
📄
Plugin.php
(850 B)
📁
Providers
Editing: GoogleClient.php
<?php namespace Botble\Analytics; use Google_Client; use Google_Exception; use LogicException; class GoogleClient extends Google_Client { /** * Set the auth config from new or deprecated JSON config. * This structure should match the file downloaded from * the "Download JSON" button on in the Google Developer * Console. * @param string|array $config the configuration json * @throws Google_Exception */ public function setAuthConfig($config) { if (is_string($config)) { if (!$config = json_decode($config, true)) { throw new LogicException('invalid data for auth config'); } } $key = isset($config['installed']) ? 'installed' : 'web'; if (isset($config['type']) && $config['type'] == 'service_account') { // application default credentials $this->useApplicationDefaultCredentials(); // set the information from the config $this->setClientId($config['client_id']); $this->setConfig('client_email', $config['client_email']); $this->setConfig('signing_key', $config['private_key']); $this->setConfig('signing_algorithm', 'HS256'); } elseif (isset($config[$key])) { // old-style $this->setClientId($config[$key]['client_id']); $this->setClientSecret($config[$key]['client_secret']); if (isset($config[$key]['redirect_uris'])) { $this->setRedirectUri($config[$key]['redirect_uris'][0]); } } else { // new-style $this->setClientId($config['client_id']); $this->setClientSecret($config['client_secret']); if (isset($config['redirect_uris'])) { $this->setRedirectUri($config['redirect_uris'][0]); } } } }
Upload File
Create Folder