當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Google_Client::getClientSecret方法代碼示例

本文整理匯總了PHP中Google_Client::getClientSecret方法的典型用法代碼示例。如果您正苦於以下問題:PHP Google_Client::getClientSecret方法的具體用法?PHP Google_Client::getClientSecret怎麽用?PHP Google_Client::getClientSecret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Google_Client的用法示例。


在下文中一共展示了Google_Client::getClientSecret方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dirname

        }
        if (isset($_SESSION[$sessTokenKey]) && isset($_SESSION[$sessTokenKey]['access_token'])) {
            $client->setAccessToken($_SESSION[$sessTokenKey]);
        }
    }
}
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
echo '<h3>' . xelfinderAdminLang('GOOGLEDRIVE_GET_TOKEN') . '</h3>';
if ($php54up) {
    $form = true;
    if ($client) {
        if (empty($_POST) && $client->getAccessToken()) {
            try {
                $aToken = $client->getAccessToken();
                $token = array('client_id' => $client->getClientId(), 'client_secret' => $client->getClientSecret(), 'access_token' => $aToken['access_token']);
                if (isset($aToken['refresh_token'])) {
                    unset($token['access_token']);
                    $token['refresh_token'] = $aToken['refresh_token'];
                }
                $ext_token = json_encode($token);
                echo '<h3>Google Drive API Token</h3>';
                echo '<div><textarea class="allselect" style="width:70%;height:5em;" spellcheck="false">' . $ext_token . '</textarea></div>';
                echo '<h3>Example to Volume Driver Setting</h3>';
                echo '<div><p>Folder ID as root: <input type=text id="xelfinder_googledrive_folder" value="root"></input> "root" is <a href="https://drive.google.com/drive/my-drive" target="_blank">"My Drive" of your Google Drive</a>.</p>';
                echo '<p>You can find the folder ID to the URL(folders/[Folder ID]) of the site of <a href="https://drive.google.com/drive/">GoogleDrive</a>.</p></div>';
                echo '<div><textarea class="allselect" style="width:70%;height:7em;" id="xelfinder_googledrive_volconf" spellcheck="false">xelfinder:flyGoogleDrive:root:GoogleDrive:gid=1|id=gd|ext_token=' . $ext_token . '</textarea></div>';
                echo "<script>(function(\$){\n\t\t\t\t\t\$('#xelfinder_googledrive_folder').on('change keyup mouseup paste', function(e) {\n\t\t\t\t\t\tvar self = \$(this);\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tvar conf = \$('#xelfinder_googledrive_volconf');\n\t\t\t\t\t\t\t\tdata = conf.val();\n\t\t\t\t\t\t\tconf.val(data.replace(/flyGoogleDrive:[^:]*:/, 'flyGoogleDrive:' + self.val() + ':'));\n\t\t\t\t\t\t}, e.type === 'paste'? 100 : 0);\n\t\t\t\t\t});\n\t\t\t\t\t\$('textarea.allselect').on('focus', function() { \$(this).select(); });\n\t\t\t\t})(jQuery);</script>";
                echo '<h4><a href="' . $selfURL . '&start">Reauthorization</a></h4>';
                $form = false;
            } catch (Google_Exception $e) {
開發者ID:nao-pon,項目名稱:xelfinder,代碼行數:31,代碼來源:googledrive.php

示例2: testIniConfig

 public function testIniConfig()
 {
     $config = parse_ini_file($this->testDir . "/config/test.ini");
     $client = new Google_Client($config);
     $this->assertEquals('My Test application', $client->getConfig('application_name'));
     $this->assertEquals('gjfiwnGinpena3', $client->getClientSecret());
 }
開發者ID:jvidor,項目名稱:google-api-php-client,代碼行數:7,代碼來源:ClientTest.php


注:本文中的Google_Client::getClientSecret方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。