-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Koushik Biswas
committed
May 21, 2017
1 parent
d3db253
commit b772477
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,72 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
use Google\Auth\ApplicationDefaultCredentials; | ||
//use GuzzleHttp\Client; | ||
//use GuzzleHttp\HandlerStack; | ||
use Google\Cloud\Datastore\DatastoreClient; | ||
|
||
try | ||
{ | ||
//============================================================================================== | ||
/* | ||
// specify the path to your application credentials | ||
putenv('GOOGLE_APPLICATION_CREDENTIALS=/home/kbxkb/cp100-bbde4d919e35.json'); | ||
// define the scopes for your API call | ||
$scopes = ['https://www.googleapis.com/auth/drive.readonly']; | ||
// create middleware | ||
$middleware = ApplicationDefaultCredentials::getMiddleware($scopes); | ||
$stack = HandlerStack::create(); | ||
$stack->push($middleware); | ||
// create the HTTP client | ||
$client = new Client([ | ||
'handler' => $stack, | ||
'base_uri' => 'https://www.googleapis.com', | ||
'auth' => 'google_auth' // authorize all requests | ||
]); | ||
// make the request | ||
$response = $client->get('drive/v2/files'); | ||
// show the result! | ||
print_r((string) $response->getBody()); | ||
*/ | ||
//============================================================================================= | ||
|
||
$projectId = 'triple-cab-162115'; | ||
$datastore = new DatastoreClient([ | ||
'projectId' => $projectId | ||
]); | ||
|
||
|
||
date_default_timezone_set('UTC'); | ||
$timenow = date('l jS \of F Y h:i:s A'); | ||
$queryval = $_GET['searchtext'] . ' ' . $timenow; | ||
echo $queryval; | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} catch (Exception $e) { | ||
echo 'Caught exception: ', $e->getMessage(), "\n"; | ||
} | ||
|
||
|
||
?> |