Conditions | 2 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function __construct() |
||
23 | { |
||
24 | if (!getenv('SS_ANALYTICS_KEY')) { |
||
25 | throw new LogicException('No analytics API set up'); |
||
26 | } |
||
27 | |||
28 | $client = new Google_Client(); |
||
29 | $client->setAuthConfig(Director::baseFolder() . DIRECTORY_SEPARATOR . getenv('SS_ANALYTICS_KEY')); |
||
30 | $client->addScope(Google_Service_Analytics::ANALYTICS_READONLY); |
||
31 | |||
32 | $this->setClient($client); |
||
33 | } |
||
51 |