Skip to content

Commit

Permalink
add google api configuration #35
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Feb 2, 2016
1 parent 642013c commit ff41c0d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ application/logs/*
application/tests/build/*
vendor/
.env
.phpintel/*
.phpintel/*
application/config/google-api.p12
23 changes: 23 additions & 0 deletions application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,3 +502,26 @@
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';

/*
|--------------------------------------------------------------------------
| Google API Config
|--------------------------------------------------------------------------
|
| Google API requires a P12 enrypted key. The key is downloaded
| from a secure location if not already present on the disk
*/
if(!file_exists(APPPATH.'config/google-api.p12')){
$out = fopen(APPPATH.'config/google-api.p12', "wb");
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, getenv("GOOGLE_API_LINK"));
curl_setopt($ch, CURLOPT_USERPWD, getenv("GOOGLE_API_KEY"));
curl_exec($ch);

curl_close($ch);
fclose($out);
}
$config['google_api_key'] = APPPATH.'config/google-api.p12';
$config['google_api_account'] = getenv("GOOGLE_API_ACCOUNT");

0 comments on commit ff41c0d

Please sign in to comment.