예제 #1
0
 /**
  * Invoke the Graph API.
  *
  * @param string $path The path (required)
  * @param string $method The http method (default 'GET')
  * @param array $params The query/post data
  * @throws Facebook\FacebookApiException
  * @return mixed The decoded response object
  */
 public function graph($path, $method = NULL, array $params = array())
 {
     if (is_array($method) && empty($params)) {
         $params = $method;
         $method = NULL;
     }
     $params['method'] = $method ?: 'GET';
     // method override as we always do a POST
     $domainKey = Facebook\Helpers::isVideoPost($path, $method) ? 'graph_video' : 'graph';
     return $this->callOauth($this->fb->config->createUrl($domainKey, $path), $params);
 }
예제 #2
0
 /**
  * Invoke the Graph API.
  *
  * @param string $path The path (required)
  * @param string $method The http method (default 'GET')
  * @param array $params The query/post data
  * @throws Facebook\FacebookApiException
  * @return mixed The decoded response object
  */
 public function graph($path, $method = NULL, array $params = array())
 {
     if (is_array($method) && empty($params)) {
         $params = $method;
         $method = NULL;
     }
     if (($i = strpos($path, '?')) !== FALSE) {
         parse_str(substr($path, $i + 1), $tmp);
         $params += $tmp;
         $path = substr($path, 0, $i);
     }
     $params['method'] = $method ?: 'GET';
     // method override as we always do a POST
     $domainKey = Facebook\Helpers::isVideoPost($path, $method) ? 'graph_video' : 'graph';
     return $this->callOauth($this->fb->config->createUrl($domainKey, $path), $params);
 }