Created
August 6, 2015 19:51
-
-
Save jimmyz/107c85f3c66e7345662a to your computer and use it in GitHub Desktop.
gedcomx-php Logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/../../vendor/autoload.php'; | |
include 'functions.php'; | |
use Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchClient; | |
use Monolog\Logger; | |
use Monolog\Handler\StreamHandler; | |
session_start(); | |
// create a log channel | |
$log = new Logger('fs-api'); | |
$log->pushHandler(new StreamHandler(__DIR__ .'/../../logs/familysearch.log', Logger::DEBUG)); | |
$clientOptions = array( | |
'environment' => 'sandbox', | |
'clientId' => 'a02j0000008LvUJAA0', | |
'redirectURI' => 'http://' . $_SERVER['HTTP_HOST'] . '/examples/OAuth2Code.php', | |
'logger' => $log | |
); | |
if(isset($_SESSION['fs_access_token'])){ | |
$clientOptions['accessToken'] = $_SESSION['fs_access_token']; | |
} | |
$client = new FamilySearchClient($clientOptions); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment