Example #1
0
 /**
  * Let's get started
  */
 protected function init()
 {
     // security - ensure we only run these scripts under CLI
     $this->requireCLI();
     parent::init();
     $this->fb = FacebookSession::newAppSession();
     try {
         $this->fb->validate();
     } catch (FacebookRequestException $ex) {
         // Session not valid, Graph API returned an exception with the reason.
         error_log($ex->getMessage());
     } catch (\Exception $ex) {
         // Graph API returned info, but it may mismatch the current app or have expired.
         error_log($ex->getMessage());
     }
 }
Example #2
0
 protected function init()
 {
     session_start();
     parent::init();
     $this->initFacebookSession();
 }