uawdijnntqw1x1x1
IP : 216.73.217.142
Hostname : localhost.localdomain
Kernel : Linux localhost.localdomain 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
devhome
/
..
/
phpmyadmin
/
..
/
doc
/
php-google-api-php-client
/
examples
/
batch.php
/
/
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ require_once '../src/Google_Client.php'; require_once '../src/contrib/Google_PlusService.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("Google+ PHP Starter Application"); $plus = new Google_PlusService($client); // Visit https://code.google.com/apis/console?api=plus to generate your // client id, client secret, and to register your redirect uri. // $client->setClientId('insert_your_oauth2_client_id'); // $client->setClientSecret('insert_your_oauth2_client_secret'); // $client->setRedirectUri('insert_your_oauth2_redirect_uri'); // $client->setDeveloperKey('insert_your_developer_key'); if (isset($_GET['logout'])) { unset($_SESSION['token']); } if (isset($_GET['code'])) { $client->authenticate(); $_SESSION['token'] = $client->getAccessToken(); $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); } if (isset($_SESSION['token'])) { $client->setAccessToken($_SESSION['token']); } if ($client->getAccessToken()) { $client->setUseBatch(true); $batch = new Google_BatchRequest(); $batch->add($plus->people->get('me'), 'key1'); $batch->add($plus->people->get('me'), 'key2'); $result = $batch->execute(); print "<pre>" . print_r($result, true) . "</pre>"; // The access token may have been updated lazily. $_SESSION['token'] = $client->getAccessToken(); } else { $authUrl = $client->createAuthUrl(); print "<a class='login' href='$authUrl'>Connect Me!</a>"; }
/var/www/devhome/../phpmyadmin/../doc/php-google-api-php-client/examples/batch.php