Ejemplo n.º 1
0
 /**
  * Stores the given ($key, $value) pair, so that future calls to
  * getPersistentData($key) return $value. This call may be in another request.
  *
  * @param string $key
  * @param array  $value
  *
  * @return void
  */
 protected function setPersistentData($key, $value)
 {
     switch ($key) {
         case 'access_token':
             $long_access_token = $this->getLongLifeAccessToken($value['access_token']);
             if (!isset($long_access_token['expires'])) {
                 // in case of API do not response the expire time, we set the default (60 days)
                 $long_access_token['expires'] = 5184000;
             }
             $this->access_token_data->setLongAccessToken($long_access_token['access_token'], $long_access_token['expires']);
             break;
     }
 }