-
Notifications
You must be signed in to change notification settings - Fork 0
/
BigQueryTest2.php
45 lines (32 loc) · 1.04 KB
/
BigQueryTest2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<body>
some text to start with <br /><br />
<?php
/**
* Copyright none
*
* prototype written to outline Onlinewillstorage GCP Bigquery integration
* Ben Newton
* https://github.com/newtob
*/
# [START bigquery_simple_app_all]
require_once 'C:\Windows\System32\vendor\autoload.php';
putenv("GOOGLE_APPLICATION_CREDENTIALS=C:\Users\\newt0b\Dropbox\OnlineWillStorage\GCP_keys\onlinewillstorage-244794d01ae6-BigQuery.json");
$Google0Auth_Creds = getenv('GOOGLE_APPLICATION_CREDENTIALS');
echo "\r\ngoogle cred address get 2 is = " . $Google0Auth_Creds;
echo "<br>";
# [START bigquery_simple_app_deps]
use Google\Cloud\BigQuery\BigQueryClient;
# [END bigquery_simple_app_deps]
// set the project ID
$projectId = 'onlinewillstorage';
# [START bigquery_simple_app_client]
$bigQuery = new BigQueryClient([
'projectId' => $projectId,
]);
# Dataset query used to test the connectivity up. The test output should = OWLs_Test_Datasetv1
#$datasets = $bigQuery->datasets();
#foreach ($datasets as $dataset) {
# print($dataset->id() . PHP_EOL);
#}
?>
</body>