This commit is contained in:
Jaybe
2025-03-05 14:10:06 +09:00
commit 7a77932344
1905 changed files with 122510 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
/*!
* A simple example that shows how to use Guzzle as a Http Client for Hybridauth instead of PHP Curl extention.
*/
include 'vendor/autoload.php';
$config = [
'callback' => Hybridauth\HttpClient\Util::getCurrentUrl(),
'keys' => ['id' => '', 'secret' => ''],
];
$guzzle = new Hybridauth\HttpClient\Guzzle(null, [
// 'verify' => true, # Set to false to disable SSL certificate verification
]);
try {
$adapter = new Hybridauth\Provider\Github($config, $guzzle);
$adapter->authenticate();
$tokens = $adapter->getAccessToken();
$userProfile = $adapter->getUserProfile();
// print_r($tokens);
// print_r($userProfile);
$adapter->disconnect();
} catch (Exception $e) {
echo $e->getMessage();
}