Created
October 13, 2015 13:40
-
-
Save YOzaz/b33814436e9b02a5f907 to your computer and use it in GitHub Desktop.
Facebook Repository with Session auto-start
This file contains 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 namespace MyApp\Utils; | |
use Facebook\Facebook; | |
use MyApp\Support\Memory\SessionManager; | |
/** | |
* @class FacebookRepository Our repository, containing commonly used queries | |
*/ | |
class FacebookRepository | |
{ | |
use SessionManager; | |
/** @var Facebook */ | |
protected $fb; | |
public function __construct() | |
{ | |
$this->startSession(); | |
$this->fb = new Facebook([ | |
'app_id' => $_ENV['facebook.app_id'], | |
'app_secret' => $_ENV['facebook.app_secret'], | |
'default_graph_version' => $_ENV['facebook.version'], | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment