Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Jul 13, 2014
2 parents 63812a5 + cd587ec commit 338c3fd
Show file tree
Hide file tree
Showing 82 changed files with 1,133 additions and 385 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ A PHP Wrapper for use with the [TMDB API](http://http://docs.themoviedb.apiary.i
---------------
[![Build Status Develop Branch](https://travis-ci.org/wtfzdotnet/php-tmdb-api.png?branch=develop)](https://travis-ci.org/wtfzdotnet/php-tmdb-api)
[![Code Coverage](https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/badges/coverage.png?s=d416e063debb3b400e9b1bc9db019f54cc1dc40e)](https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/badges/quality-score.png?s=dad36710f36335bdeffeaf2ac256c222862832fa)](https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/)
[![License](https://poser.pugx.org/wtfzdotnet/php-tmdb-api/license.png)](https://packagist.org/packages/wtfzdotnet/php-tmdb-api)

Inspired by [php-github-api](https://github.com/KnpLabs/php-github-api), [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api/) and the Symfony2 Community.
Expand Down
25 changes: 25 additions & 0 deletions examples/changes/api/tv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);

$tvChanges = $client->getChangesApi()->getTvChanges(array(
'page' => 1,
'start_date' => '2014-01-14',
'end_date' => '2014-01-21'
));

var_dump($tvChanges);
33 changes: 33 additions & 0 deletions examples/changes/model/tv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);

$query = new \Tmdb\Model\Query\ChangesQuery();

$from = new \DateTime('14-01-2014');
$to = new \DateTime('21-01-2014');

$query
->page(1)
->from($from)
->to($to)
;

$repository = new \Tmdb\Repository\ChangesRepository($client);
$response = $repository->getTvChanges($query);

var_dump($response);
2 changes: 2 additions & 0 deletions examples/people/model/tagged_images.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
ini_set('display_errors', 'On');

require_once '../../../vendor/autoload.php';
require_once '../../../apikey.php';

Expand Down
21 changes: 21 additions & 0 deletions examples/search/api/multi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);

$result = $client->getSearchApi()->searchMulti('jack');

var_dump($result);
26 changes: 26 additions & 0 deletions examples/search/model/multi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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);

$query = new \Tmdb\Model\Search\SearchQuery\KeywordSearchQuery();
$query->page(1);

$repository = new \Tmdb\Repository\SearchRepository($client);

$find = $repository->searchMulti('jack', $query);

var_dump($find);
24 changes: 24 additions & 0 deletions examples/tv/api/episode/account_states.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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 = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$result = $client->getTvEpisodeApi()->getAccountStates(1396, 1, 1);

var_dump($result);
25 changes: 25 additions & 0 deletions examples/tv/api/episode/rate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
ini_set('display_errors', 'On');
require_once '../../../../vendor/autoload.php';
require_once '../../../../apikey.php';

$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$result = $client->getTvEpisodeApi()->rateTvEpisode(1396, 1, 1, 9.5);

var_dump($result);
24 changes: 24 additions & 0 deletions examples/tv/api/tv/account_states.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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 = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$result = $client->getTvApi()->getAccountStates(1396);

var_dump($result);
25 changes: 25 additions & 0 deletions examples/tv/api/tv/rate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
ini_set('display_errors', 'On');
require_once '../../../../vendor/autoload.php';
require_once '../../../../apikey.php';

$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$result = $client->getTvApi()->rateTvShow(1396, 9.5);

var_dump($result);
25 changes: 25 additions & 0 deletions examples/tv/model/episode/account_states.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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 = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$tvShow = $repository->getAccountStates(1396, 1, 1);

var_dump($tvShow);
26 changes: 26 additions & 0 deletions examples/tv/model/episode/rate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
ini_set('display_errors','on');
require_once '../../../../vendor/autoload.php';
require_once '../../../../apikey.php';

$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$repository = new \Tmdb\Repository\TvEpisodeRepository($client);
$rate = $repository->rate(1396, 1, 1, 9.5);

var_dump($rate);
25 changes: 25 additions & 0 deletions examples/tv/model/tv/account_states.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @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 = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$repository = new \Tmdb\Repository\TvRepository($client);
$tvShow = $repository->getAccountStates(1396);

var_dump($tvShow);
26 changes: 26 additions & 0 deletions examples/tv/model/tv/rate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, Michael Roterman
* @version 0.0.1
*/
ini_set('display_errors','on');
require_once '../../../../vendor/autoload.php';
require_once '../../../../apikey.php';

$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

$sessionToken = new \Tmdb\SessionToken(TMDB_SESSION_TOKEN);
$client->setSessionToken($sessionToken);

$repository = new \Tmdb\Repository\TvRepository($client);
$rate = $repository->rate(1396, 9.5);

var_dump($rate);
24 changes: 12 additions & 12 deletions lib/Tmdb/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public function head($path, array $parameters = array(), $headers = array())
/**
* Send a POST request
*
* @param $path
* @param null $postBody
* @param array $parameters
* @param array $headers
* @param string $path
* @param null $postBody
* @param array $parameters
* @param array $headers
* @return mixed
*/
public function post($path, $postBody = null, array $parameters = array(), $headers = array())
Expand All @@ -96,10 +96,10 @@ public function post($path, $postBody = null, array $parameters = array(), $head
/**
* Send a POST request but json_encode the post body in the request
*
* @param $path
* @param null $postBody
* @param array $parameters
* @param array $headers
* @param string $path
* @param array|null $postBody
* @param array $parameters
* @param array $headers
* @return mixed
*/
public function postJson($path, $postBody = null, array $parameters = array(), $headers = array())
Expand Down Expand Up @@ -138,10 +138,10 @@ public function put($path, $body = null, array $parameters = array(), $headers =
/**
* Send a DELETE request
*
* @param $path
* @param null $body
* @param array $parameters
* @param array $headers
* @param string $path
* @param null $body
* @param array $parameters
* @param array $headers
* @return mixed
*/
public function delete($path, $body = null, array $parameters = array(), $headers = array())
Expand Down
Loading

0 comments on commit 338c3fd

Please sign in to comment.