Skip to content

Google api - bigquery & Appengine - cannot create dataset #1

Description

@matanc244

0
down vote
favorite
I am trying to create a new Dataset inside Google Bigquery while using Google App Engine as a server .

this is the code i was using -

set_include_path("Google/" . PATH_SEPARATOR . get_include_path());
require_once 'Service.php';
require_once 'Client.php';
require_once 'Service/Resource.php';
require_once 'Model.php';
require_once 'Collection.php';
require_once 'Service/Bigquery.php';

$project_id = "test";
$dataset_id = "TestDataset";

$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$client->addScope(Google_Service_Bigquery::BIGQUERY);

$bigquery = new Google_Service_Bigquery($client);

$ConfigureDataset = new Google_Service_Bigquery_DatasetReference();
$ConfigureDataset->setProjectId($project_id);
$ConfigureDataset->setDatasetId($dataset_id);

$dataset = new Google_Service_Bigquery_Dataset();
$dataset->setDatasetReference($ConfigureDataset);
$dataset->setDescription($dataset_id);

$options = array();

$response = $bigquery->datasets->insert($project_id,$dataset,$options);
The error I am getting is -

Fatal error: Class 'Monolog\Logger' not found in /base/data/home/apps/1.392457623149040913/Google/Client.php on line 963
On Client link 963 i found this -

protected function createDefaultLogger()
{
$logger = new Logger('google-api-php-client');
$logger->pushHandler(new MonologStreamHandler('php://stderr', Logger::NOTICE));

return $logger;
}

Than i looked for this class on the Google api and didn't find it .

This is the api i downloaded -

https://github.com/google/google-api-php-client
What can be the problem ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions