Sto sperimentando con SammyK/LaravelFacebookSdk. tenta di eseguire questa linea da esempio: $response = Facebook::get('/me?fields=id,name,email', 'user-access-token');
L'argomento 3 passato a GuzzleHttp Client :: request() deve essere del tipo array, stringa data
che a sua volta è compatibile /var/www/vendor/facebook/php-sdk-v4/src/Facebook/HttpClients/FacebookGuzzleHttpClient.php line 61
public function send($url, $method, $body, array $headers, $timeOut)
{
$options = [
'headers' => $headers,
'body' => $body,
'timeout' => $timeOut,
'connect_timeout' => 10,
'verify' => __DIR__ . '/certs/DigiCertHighAssuranceEVRootCA.pem',
];
$request = $this->guzzleClient->createRequest($method, $url, $options);
try {
$rawResponse = $this->guzzleClient->send($request);
} catch (RequestException $e) {
$rawResponse = $e->getResponse();
if ($e->getPrevious() instanceof RingException || !$rawResponse instanceof ResponseInterface) {
throw new FacebookSDKException($e->getMessage(), $e->getCode());
}
}
$rawHeaders = $this->getHeadersAsString($rawResponse);
$rawBody = $rawResponse->getBody();
$httpStatusCode = $rawResponse->getStatusCode();
return new GraphRawResponse($rawHeaders, $rawBody, $httpStatusCode);
}
che chiama /var/www/vendor/guzzlehttp/guzzle/src/Client.php line 87
public function __call($method, $args)
{
if (count($args) < 1) {
throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
}
$uri = $args[0];
$opts = isset($args[1]) ? $args[1] : [];
return substr($method, -5) === 'Async'
? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
: $this->request($method, $uri, $opts);
}
Questo methond interpreta input come array('method' => 'createRequest', 'uri' => 'GET'))
Modifica indice sembra per correggere l'errore (anche se altri problemi r araise)
$uri = $args[1];
$opts = isset($args[2]) ? $args[2] : [];
Ma dal momento che si tratta di una cattiva pratica di modificare altri pacchetti, come devo correggere questo errore?
Hi Edmund, non sei sicuro di aver già trovato la soluzione? Io qui mi sono imbattuto nello stesso problema :( –
@KeithYeoh Ho scaricato il plug-in e ho scritto il codice personalmente o usato Socialte (plugin ufficiale di laravels) + un codice di protezione personale .Non ricordo davvero. Ricordo solo la sensazione che la mia soluzione molto più pulito e semplice del plug-in –