From b8f2174349d2d947df01b9e5d3f9c6d76a2638a0 Mon Sep 17 00:00:00 2001 From: Michael Roterman Date: Tue, 25 Feb 2014 00:54:43 +0100 Subject: [PATCH] Adding guest_session --- .../authentication/api/get-guest-session.php | 21 +++++++++++++++++++ lib/Tmdb/Api/Authentication.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 examples/authentication/api/get-guest-session.php diff --git a/examples/authentication/api/get-guest-session.php b/examples/authentication/api/get-guest-session.php new file mode 100644 index 00000000..8712ffb5 --- /dev/null +++ b/examples/authentication/api/get-guest-session.php @@ -0,0 +1,21 @@ + + * @copyright (c) 2013, Michael Roterman + * @version 0.0.1 + */ +require_once('../../../vendor/autoload.php'); +require_once('../../../apikey.php'); + +$token = new \Tmdb\ApiToken(TMDB_API_KEY); +$client = new \Tmdb\Client($token); + +$sessionToken = $client->getAuthenticationApi()->getNewGuestSession(); + +var_dump($sessionToken); \ No newline at end of file diff --git a/lib/Tmdb/Api/Authentication.php b/lib/Tmdb/Api/Authentication.php index d6738de0..94ac0cb5 100644 --- a/lib/Tmdb/Api/Authentication.php +++ b/lib/Tmdb/Api/Authentication.php @@ -85,6 +85,6 @@ public function getNewSession($requestToken) */ public function getNewGuestSession() { - throw new NotImplementedException(__METHOD__ . ' has not been implemented yet.'); + return $this->get('authentication/guest_session/new'); } }