当前位置: 首页>>代码示例>>PHP>>正文


PHP apiClient类代码示例

本文整理汇总了PHP中apiClient的典型用法代码示例。如果您正苦于以下问题:PHP apiClient类的具体用法?PHP apiClient怎么用?PHP apiClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了apiClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDefault

 public function actionDefault()
 {
     $google_config = NEnvironment::getConfig()->google;
     require_once LIBS_DIR . '/google-api-php-client/src/apiClient.php';
     require_once LIBS_DIR . '/google-api-php-client/src/contrib/apiOauth2Service.php';
     require_once LIBS_DIR . '/google-api-php-client/src/contrib/apiAnalyticsService.php';
     $client = new apiClient();
     $client->setApplicationName('Google+ PHP Starter Application');
     // Visit https://code.google.com/apis/console?api=plus to generate your
     // client id, client secret, and to register your redirect uri.
     //		$client->setClientId( $google_config['client_id'] );
     //		$client->setClientSecret( $google_config['client_secret'] );
     $client->setRedirectUri($google_config['redirect_url']);
     //		$client->setDeveloperKey('AIzaSyCrViGDrmXAiLsQAoW1aOzkHddH9gHYzzs');
     //		[8] => Array
     //        (
     //            [title] => www.propagacnepredmety.sk
     //            [entryid] => http://www.google.com/analytics/feeds/accounts/ga:43556790
     //            [accountId] => 17205615
     //            [accountName] => www.vizion.sk
     //            [profileId] => 43556790
     //            [webPropertyId] => UA-17205615-3
     //            [tableId] => ga:43556790
     //        )
     $ga = new apiAnalyticsService($client);
     if (isset($_GET['code'])) {
         $ga->authenticate();
         $_SESSION['token'] = $client->getAccessToken();
         header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
     }
     if (isset($_SESSION['token'])) {
         $client->setAccessToken($_SESSION['token']);
     }
     if ($client->getAccessToken()) {
         $activities = $plus->activities->listActivities('me', 'public');
         print 'Your Activities: <pre>' . print_r($activities, true) . '</pre>';
         // The access token may have been updated.
         $_SESSION['token'] = $client->getAccessToken();
     } else {
         $authUrl = $client->createAuthUrl();
         print "<a class='login' href='{$authUrl}'>Connect Me!</a>";
     }
     //		$_SESSION['token'] = $client->getAccessToken();
     $data = $ga->data_ga;
     $d = $data->get('17205615', date('Y-m-d', time() - 60 * 60 * 24 * 40), date('Y-m-d', time() - 60 * 60 * 24 * 1), 'ga:visits,ga:pageviews');
     print_r($d);
     exit;
 }
开发者ID:oaki,项目名称:demoshop,代码行数:48,代码来源:Admin_Stats_GoogleAnalyticsPresenter.php

示例2: __construct

 /**
  * Constructs the internal service representations and does the auto-magic configuration required to drive them
  */
 public function __construct(apiClient $apiClient)
 {
     $apiClient->addService('prediction', 'v1.1');
     $this->io = $apiClient->getIo();
     $this->training = new apiServiceResource($this, $this->serviceName, 'training', json_decode('{"methods":{"insert":{"pathUrl":"prediction\\/v1.1\\/training","rpcName":"prediction.training.insert","httpMethod":"POST","methodType":"rest","parameters":{"data":{"parameterType":"query","required":false}}},"delete":{"pathUrl":"prediction\\/v1.1\\/training\\/{data}","rpcName":"prediction.training.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"data":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"get":{"pathUrl":"prediction\\/v1.1\\/training\\/{data}","rpcName":"prediction.training.get","httpMethod":"GET","methodType":"rest","parameters":{"data":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->prediction = new apiServiceResource($this, $this->serviceName, 'prediction', json_decode('{"methods":{"predict":{"pathUrl":"prediction\\/v1.1\\/training\\/{data}\\/predict","rpcName":"prediction.predict","httpMethod":"POST","methodType":"rest","parameters":{"input":{"parameterType":"query","required":false},"data":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
 }
开发者ID:wty717,项目名称:heka-interactive-google-buzz-app,代码行数:10,代码来源:apiPredictionService.php

示例3: __construct

 /**
  * Constructs the internal service representations and does the auto-magic configuration required to drive them
  */
 public function __construct(apiClient $apiClient)
 {
     $apiClient->addService('easyhybrid', 'v1');
     $this->io = $apiClient->getIo();
     $this->useremail = new apiServiceResource($this, $this->serviceName, 'useremail', json_decode('{"methods":{"get":{"pathUrl":"userinfo\\/email","rpcName":"auth.useremail.get","httpMethod":"GET","methodType":"rest"}}}', true));
     $this->userinfo = new apiServiceResource($this, $this->serviceName, 'userinfo', json_decode('{"methods":{"get":{"pathUrl":"easyhybrid\\/userinfo","rpcName":"auth.userinfo.get","httpMethod":"GET","methodType":"rest"}}}', true));
 }
开发者ID:wty717,项目名称:heka-interactive-google-buzz-app,代码行数:10,代码来源:apiEasyhybridService.php

示例4: __construct

  public function __construct() {
    global $apiConfig, $apiBuzzTest_apiClient, $apiBuzzTest_buzz;
    parent::__construct();

    if (! $apiBuzzTest_apiClient || ! $apiBuzzTest_buzz) {

      $this->origConfig = $apiConfig;
      // Set up a predictable, default environment so the test results are predictable
      //$apiConfig['oauth2_client_id'] = 'INSERT_CLIENT_ID';
      //$apiConfig['oauth2_client_secret'] = 'INSERT_CLIENT_SECRET';
      $apiConfig['authClass'] = 'apiOAuth2';

     
      $apiConfig['ioClass'] = 'apiCurlIO';
      $apiConfig['cacheClass'] = 'apiFileCache';
      $apiConfig['ioFileCache_directory'] = '/tmp/googleApiTests';

      // create the global api and buzz clients (which are shared between the various buzz test suites for performance reasons)
      $apiBuzzTest_apiClient = new apiClient();
      $apiBuzzTest_buzz = new apiBuzzService($apiBuzzTest_apiClient);
      $apiBuzzTest_apiClient->setAccessToken($apiConfig['oauth_test_token']);
    }
    $this->apiClient = $apiBuzzTest_apiClient;
    $this->buzz = $apiBuzzTest_buzz;
  }
开发者ID:newshorts,项目名称:Google-Plus-API---PHP,代码行数:25,代码来源:apiBuzzTest.php

示例5: loadEvents

/**
 * Load the list of upcoming events in the UPL and return an array containing
 * an array of each event's information.
 */
function loadEvents()
{
    if (!class_exists('apiClient')) {
        return array();
    }
    // Load up the Google API client
    $client = new apiClient();
    $client->setApplicationName('UPL Website');
    $client->setUseObjects(true);
    apiKey($client);
    $cal = new apiCalendarService($client);
    // List all events in the UPL calendar
    $calendarId = '42jcv5rucaf2h6ehk89gbbog5g@group.calendar.google.com';
    $args = array('singleEvents' => true, 'orderBy' => 'startTime', 'maxResults' => 5, 'timeMin' => date(DateTime::RFC3339));
    $events = $cal->events->listEvents($calendarId, $args);
    // Make sure that we at least have some events
    if (!$events) {
        return array();
    }
    $events = $events->getItems();
    if (!is_array($events)) {
        return array();
    }
    // Just a little helper to convert dates
    function makeDate($evtDate)
    {
        return DateTime::createFromFormat(DateTime::RFC3339, $evtDate->getDateTime());
    }
    function mapEvent($event)
    {
        return array('summary' => $event->getSummary(), 'start' => makeDate($event->getStart()), 'end' => makeDate($event->getEnd()), 'description' => $event->getDescription(), 'link' => $event->getHtmlLink());
    }
    // Retrieve all our events
    return array_map(mapEvent, $events);
}
开发者ID:LOZORD,项目名称:UPL-Website-Revamp,代码行数:39,代码来源:events.php

示例6: __construct

 /**
  * Constructs the internal service representations and does the auto-magic configuration required to drive them
  */
 public function __construct(apiClient $apiClient)
 {
     $apiClient->addService('latitude', 'v1');
     $this->io = $apiClient->getIo();
     $this->location = new apiServiceResource($this, $this->serviceName, 'location', json_decode('{"methods":{"insert":{"pathUrl":"latitude\\/v1\\/location","rpcName":"latitude.location.insert","httpMethod":"POST","methodType":"rest"},"list":{"pathUrl":"latitude\\/v1\\/location","rpcName":"latitude.location.list","httpMethod":"GET","methodType":"rest","parameters":{"max-time":{"parameterType":"query","required":false},"min-time":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"granularity":{"parameterType":"query","required":false}}},"get":{"pathUrl":"latitude\\/v1\\/location\\/{locationId}","rpcName":"latitude.location.get","httpMethod":"GET","methodType":"rest","parameters":{"granularity":{"parameterType":"query","required":false},"locationId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"delete":{"pathUrl":"latitude\\/v1\\/location\\/{locationId}","rpcName":"latitude.location.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"locationId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->currentLocation = new apiServiceResource($this, $this->serviceName, 'currentLocation', json_decode('{"methods":{"insert":{"pathUrl":"latitude\\/v1\\/currentLocation","rpcName":"latitude.currentLocation.insert","httpMethod":"POST","methodType":"rest"},"delete":{"pathUrl":"latitude\\/v1\\/currentLocation","rpcName":"latitude.currentLocation.delete","httpMethod":"DELETE","methodType":"rest"},"get":{"pathUrl":"latitude\\/v1\\/currentLocation","rpcName":"latitude.currentLocation.get","httpMethod":"GET","methodType":"rest","parameters":{"granularity":{"parameterType":"query","required":false}}}}}', true));
 }
开发者ID:wty717,项目名称:heka-interactive-google-buzz-app,代码行数:10,代码来源:apiLatitudeService.php

示例7: __construct

 /**
  * Constructs the internal representation of the Pagespeedonline service.
  *
  * @param apiClient apiClient
  */
 public function __construct(apiClient $apiClient)
 {
     $this->restBasePath = '/pagespeedonline/v1/';
     $this->version = 'v1';
     $this->serviceName = 'pagespeedonline';
     $apiClient->addService($this->serviceName, $this->version);
     $this->pagespeedapi = new PagespeedapiServiceResource($this, $this->serviceName, 'pagespeedapi', json_decode('{"methods": {"runpagespeed": {"parameters": {"locale": {"type": "string", "location": "query"}, "url": {"required": true, "type": "string", "location": "query"}, "rule": {"repeated": true, "type": "string", "location": "query"}, "strategy": {"enum": ["desktop", "mobile"], "type": "string", "location": "query"}}, "id": "pagespeedonline.pagespeedapi.runpagespeed", "httpMethod": "GET", "path": "runPagespeed", "response": {"$ref": "Result"}}}}', true));
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:13,代码来源:apiPagespeedonlineService.php

示例8: __construct

 /**
  * Constructs the internal representation of the Webfonts service.
  *
  * @param apiClient apiClient
  */
 public function __construct(apiClient $apiClient)
 {
     $this->restBasePath = '/webfonts/v1/';
     $this->version = 'v1';
     $this->serviceName = 'webfonts';
     $apiClient->addService($this->serviceName, $this->version);
     $this->webfonts = new WebfontsServiceResource($this, $this->serviceName, 'webfonts', json_decode('{"methods": {"list": {"parameters": {"sort": {"enum": ["alpha", "date", "popularity", "style", "trending"], "type": "string", "location": "query"}}, "id": "webfonts.webfonts.list", "httpMethod": "GET", "path": "webfonts", "response": {"$ref": "WebfontList"}}}}', true));
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:13,代码来源:apiWebfontsService.php

示例9: __construct

 /**
  * Constructs the internal representation of the Autocompleteapi service.
  *
  * @param apiClient apiClient
  */
 public function __construct(apiClient $apiClient)
 {
     $this->rpcPath = '/rpc';
     $this->restBasePath = '/search/v2/';
     $this->version = '1.0';
     $this->serviceName = 'autocompleteapi';
     $this->io = $apiClient->getIo();
     $apiClient->addService($this->serviceName, $this->version);
     $this->AutocompleteMethods = new AutocompleteMethodsServiceResource($this, $this->serviceName, 'AutocompleteMethods', json_decode('{"methods": {"Autocomplete": {"path": "{endpoint}/autocomplete", "httpMethod": "GET", "id": "AutocompleteAPI.Autocomplete", "parameters": {"endpoint": {"required": true, "default": "music", "enum": ["music", "amgvideo", "video"], "location": "path", "type": "string"}, "language": {"default": "en", "required": false, "type": "string", "location": "query"}, "format": {"required": false, "default": "json", "enum": ["json", "xml"], "location": "query", "type": "string"}, "country": {"default": "US", "required": false, "type": "string", "location": "query"}, "entitytype": {"required": true, "default": "", "enum": ["album", "song", "artist", "movie", "tvseries", "credit", "movie", "tvseries", "onetimeonly", "credit"], "location": "query", "type": "string"}, "filter": {"default": "", "required": false, "type": "string", "location": "query"}, "query": {"default": "", "required": true, "type": "string", "location": "query"}, "size": {"default": 20, "required": false, "type": "integer", "location": "query"}}}}}', true));
 }
开发者ID:nortron,项目名称:io-wraps-rovi-php,代码行数:15,代码来源:apiAutocompleteapiService.php

示例10: __construct

 /**
  * Constructs the internal service representations and does the auto-magic configuration required to drive them
  */
 public function __construct(apiClient $apiClient)
 {
     $apiClient->addService('moderator', 'v1');
     $this->io = $apiClient->getIo();
     $this->tags = new apiServiceResource($this, $this->serviceName, 'tags', json_decode('{"methods":{"delete":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/tags\\/{tagId}","rpcName":"moderator.tags.delete","httpMethod":"DELETE","methodType":"rest","parameters":{"tagId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"list":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/tags","rpcName":"moderator.tags.list","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"insert":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/tags","rpcName":"moderator.tags.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->series = new apiServiceResource($this, $this->serviceName, 'series', json_decode('{"methods":{"list":{"pathUrl":"moderator\\/v1\\/series\\/featured","rpcName":"moderator.featured.series.list","httpMethod":"GET","methodType":"rest"},"update":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}","rpcName":"moderator.series.update","httpMethod":"PUT","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"insert":{"pathUrl":"moderator\\/v1\\/series","rpcName":"moderator.series.insert","httpMethod":"POST","methodType":"rest"},"get":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}","rpcName":"moderator.series.get","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->topics = new apiServiceResource($this, $this->serviceName, 'topics', json_decode('{"methods":{"list":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics","rpcName":"moderator.topics.list","httpMethod":"GET","methodType":"rest","parameters":{"max-results":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"insert":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics","rpcName":"moderator.topics.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"get":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics\\/{topicId}","rpcName":"moderator.topics.get","httpMethod":"GET","methodType":"rest","parameters":{"topicId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->votes = new apiServiceResource($this, $this->serviceName, 'votes', json_decode('{"methods":{"update":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/votes\\/@me","rpcName":"moderator.votes.update","httpMethod":"PUT","methodType":"rest","parameters":{"userId":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"list":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/votes\\/@me","rpcName":"moderator.votes.list","httpMethod":"GET","methodType":"rest","parameters":{"max-results":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"get":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/votes\\/@me","rpcName":"moderator.votes.get","httpMethod":"GET","methodType":"rest","parameters":{"userId":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"insert":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}\\/votes\\/@me","rpcName":"moderator.votes.insert","httpMethod":"POST","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->submissions = new apiServiceResource($this, $this->serviceName, 'submissions', json_decode('{"methods":{"get":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/submissions\\/{submissionId}","rpcName":"moderator.submissions.get","httpMethod":"GET","methodType":"rest","parameters":{"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"submissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"list":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics\\/{topicId}\\/submissions","rpcName":"moderator.topics.submissions.list","httpMethod":"GET","methodType":"rest","parameters":{"author":{"parameterType":"query","required":false},"hasAttachedVideo":{"parameterType":"query","required":false},"sort":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"q":{"parameterType":"query","required":false},"topicId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"insert":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics\\/{topicId}\\/submissions","rpcName":"moderator.submissions.insert","httpMethod":"POST","methodType":"rest","parameters":{"topicId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
     $this->profiles = new apiServiceResource($this, $this->serviceName, 'profiles', json_decode('{"methods":{"get":{"pathUrl":"moderator\\/v1\\/profiles\\/@me","rpcName":"moderator.profiles.get","httpMethod":"GET","methodType":"rest"},"update":{"pathUrl":"moderator\\/v1\\/profiles\\/@me","rpcName":"moderator.profiles.update","httpMethod":"PUT","methodType":"rest"}}}', true));
     $this->responses = new apiServiceResource($this, $this->serviceName, 'responses', json_decode('{"methods":{"insert":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/topics\\/{topicId}\\/submissions\\/{parentSubmissionId}\\/responses","rpcName":"moderator.responses.insert","httpMethod":"POST","methodType":"rest","parameters":{"parentSubmissionId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"topicId":{"parameterType":"path","pattern":"[^\\/]+","required":true},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}},"list":{"pathUrl":"moderator\\/v1\\/series\\/{seriesId}\\/responses","rpcName":"moderator.series.responses.list","httpMethod":"GET","methodType":"rest","parameters":{"author":{"parameterType":"query","required":false},"hasAttachedVideo":{"parameterType":"query","required":false},"sort":{"parameterType":"query","required":false},"max-results":{"parameterType":"query","required":false},"q":{"parameterType":"query","required":false},"start-index":{"parameterType":"query","required":false},"seriesId":{"parameterType":"path","pattern":"[^\\/]+","required":true}}}}}', true));
 }
开发者ID:wty717,项目名称:heka-interactive-google-buzz-app,代码行数:15,代码来源:apiModeratorService.php

示例11: BuildService

 /**
  * Build a Drive service object for interacting with the Google Drive API.
  *
  * @return apiDriveService service object
  */
 function BuildService($credentials)
 {
     $client = new apiClient();
     // return data from API calls as PHP objects instead of arrays
     $client->setUseObjects(true);
     $client->setAccessToken($credentials->toJson());
     // set clientId and clientSecret in case token is expired
     // and refresh is needed
     $client->setClientId($credentials->clientId);
     $client->setClientSecret($credentials->clientSecret);
     return new apiDriveService($client);
 }
开发者ID:Legallyplayed,项目名称:hrovira-mavenized-google-drive-sdk-samples,代码行数:17,代码来源:drive_handler.php

示例12: index

 public function index()
 {
     $this->id = "content";
     $this->template = "login/login.tpl";
     $this->layout = "common/layout-empty";
     if (Registry::get('username')) {
         header("Location: search.php");
         exit;
     }
     $request = Registry::get('request');
     $session = Registry::get('session');
     $db = Registry::get('db');
     $this->load->model('user/auth');
     $this->load->model('user/user');
     $this->load->model('user/prefs');
     $this->load->model('domain/domain');
     $this->load->model('folder/folder');
     if (ENABLE_SAAS == 1) {
         $this->load->model('saas/ldap');
         $this->load->model('saas/customer');
     }
     $this->data['title'] = $this->data['text_login'];
     $this->data['title_prefix'] = TITLE_PREFIX;
     $this->data['failed_login_count'] = $this->model_user_auth->get_failed_login_count();
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate() == true) {
         if ($this->model_user_auth->checkLogin($this->request->post['username'], $_POST['password']) == 1) {
             if ($session->get("ga_block") == 1) {
                 header("Location: " . SITE_URL . "index.php?route=login/ga");
                 exit;
             } else {
                 $this->model_user_prefs->get_user_preferences($session->get('username'));
                 if (ENABLE_SAAS == 1) {
                     $this->model_saas_customer->online($session->get('email'));
                 }
                 LOGGER('logged in');
                 if (isAdminUser() == 1) {
                     header("Location: " . SITE_URL . "index.php?route=health/health");
                     exit;
                 }
                 header("Location: " . SITE_URL . "search.php");
                 exit;
             }
         } else {
             $this->model_user_auth->increment_failed_login_count($this->data['failed_login_count']);
             $this->data['failed_login_count']++;
         }
         $this->data['x'] = $this->data['text_invalid_email_or_password'];
     }
     if (ENABLE_GOOGLE_LOGIN == 1) {
         $client = new apiClient();
         $client->setApplicationName(GOOGLE_APPLICATION_NAME);
         $client->setScopes(array('https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://mail.google.com/'));
         $client->setClientId(GOOGLE_CLIENT_ID);
         $client->setClientSecret(GOOGLE_CLIENT_SECRET);
         $client->setRedirectUri(GOOGLE_REDIRECT_URL);
         $client->setDeveloperKey(GOOGLE_DEVELOPER_KEY);
         $this->data['auth_url'] = $client->createAuthUrl();
     }
     $this->render();
 }
开发者ID:buxiaoyang,项目名称:EmailArchive,代码行数:60,代码来源:login.php

示例13: __construct

 /**
  * Constructs the internal representation of the Customsearch service.
  *
  * @param apiClient apiClient
  */
 public function __construct(apiClient $apiClient)
 {
     $this->rpcPath = '/rpc';
     $this->restBasePath = '/customsearch/';
     $this->version = 'v1';
     $this->serviceName = 'customsearch';
     $apiClient->addService($this->serviceName, $this->version);
     $this->cse = new CseServiceResource($this, $this->serviceName, 'cse', json_decode('{"methods": {"list": {"parameters": {"sort": {"type": "string", "location": "query"}, "filter": {"enum": ["0", "1"], "type": "string", "location": "query"}, "cx": {"type": "string", "location": "query"}, "googlehost": {"type": "string", "location": "query"}, "safe": {"default": "off", "enum": ["high", "medium", "off"], "location": "query", "type": "string"}, "q": {"required": true, "type": "string", "location": "query"}, "start": {"type": "string", "location": "query"}, "num": {"default": "10", "type": "string", "location": "query"}, "lr": {"enum": ["lang_ar", "lang_bg", "lang_ca", "lang_cs", "lang_da", "lang_de", "lang_el", "lang_en", "lang_es", "lang_et", "lang_fi", "lang_fr", "lang_hr", "lang_hu", "lang_id", "lang_is", "lang_it", "lang_iw", "lang_ja", "lang_ko", "lang_lt", "lang_lv", "lang_nl", "lang_no", "lang_pl", "lang_pt", "lang_ro", "lang_ru", "lang_sk", "lang_sl", "lang_sr", "lang_sv", "lang_tr", "lang_zh-CN", "lang_zh-TW"], "type": "string", "location": "query"}, "cr": {"type": "string", "location": "query"}, "gl": {"type": "string", "location": "query"}, "cref": {"type": "string", "location": "query"}}, "id": "search.cse.list", "httpMethod": "GET", "path": "v1", "response": {"$ref": "Search"}}}}', true));
 }
开发者ID:httvncoder,项目名称:151722441,代码行数:14,代码来源:apiCustomsearchService.php

示例14: __construct

 /**
  * Constructs the internal representation of the Diacritize service.
  *
  * @param apiClient apiClient
  */
 public function __construct(apiClient $apiClient)
 {
     $this->rpcPath = '/rpc';
     $this->restBasePath = '/language/diacritize/';
     $this->version = 'v1';
     $this->serviceName = 'diacritize';
     $this->io = $apiClient->getIo();
     $apiClient->addService($this->serviceName, $this->version);
     $this->diacritize = new DiacritizeServiceResource($this, $this->serviceName, 'diacritize', json_decode('{"resources": {"corpus": {"methods": {"get": {"parameters": {"lang": {"required": true, "type": "string", "location": "query"}, "message": {"required": true, "type": "string", "location": "query"}, "last_letter": {"required": true, "type": "boolean", "location": "query"}}, "id": "language.diacritize.corpus.get", "httpMethod": "GET", "path": "v1", "response": {"$ref": "LanguageDiacritizeCorpusResource"}}}}}}', true));
 }
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:15,代码来源:apiDiacritizeService.php

示例15: __construct

  public function __construct() {
    global $apiConfig, $apiClient, $taskService;
    parent::__construct();

    if (! $apiClient || ! $taskService) {
      $this->origConfig = $apiConfig;
      // Set up a predictable, default environment so the test results are predictable
      //$apiConfig['oauth2_client_id'] = 'INSERT_CLIENT_ID';
      //$apiConfig['oauth2_client_secret'] = 'INSERT_CLIENT_SECRET';
      $apiConfig['authClass'] = 'apiOAuth2';
      $apiConfig['ioClass'] = 'apiCurlIO';
      $apiConfig['cacheClass'] = 'apiFileCache';
      $apiConfig['ioFileCache_directory'] = '/tmp/googleApiTests';

      $apiClient = new apiClient();
      $taskService = new apiTasksService($apiClient);
      $apiClient->setAccessToken($apiConfig['oauth_test_token']);
    }
    $this->apiClient = $apiClient;
    $this->taskService = $taskService;
  }
开发者ID:newshorts,项目名称:Google-Plus-API---PHP,代码行数:21,代码来源:TasksTest.php


注:本文中的apiClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。