Skip to content

Commit

Permalink
Added datastore library, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Biswas committed May 21, 2017
1 parent d3db253 commit b772477
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions calldatastore.php
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";
}


?>

0 comments on commit b772477

Please sign in to comment.