Skip to content

Commit

Permalink
Adding .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Nov 1, 2013
0 parents commit 710fa72
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/composer.lock
/*.php
/.idea/
19 changes: 19 additions & 0 deletions lib/Tmdb/Api/ApiInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* This file is part of the Wrike PHP API created by B-Found IM&S.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Wrike
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, B-Found Internet Marketing & Services
* @version 0.0.1
*/

namespace Tmdb\Api;


interface ApiInterface {

}
19 changes: 19 additions & 0 deletions lib/Tmdb/Api/Movies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* This file is part of the Wrike PHP API created by B-Found IM&S.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Wrike
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, B-Found Internet Marketing & Services
* @version 0.0.1
*/

namespace Tmdb\Api;


class Movies {

}
48 changes: 48 additions & 0 deletions lib/Tmdb/HttpClient/Plugin/AcceptJsonHeader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* This file is part of the Wrike PHP API created by B-Found IM&S.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Wrike
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, B-Found Internet Marketing & Services
* @version 0.0.1
*/

namespace Tmdb\HttpClient\Plugin;

use Guzzle\Common\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Tmdb\ApiToken;

class ApiTokenPlugin implements EventSubscriberInterface
{
/**
* @var \Tmdb\ApiToken
*/
private $token;

public function __construct(ApiToken $token)
{
$this->token = $token;
}

public static function getSubscribedEvents()
{
return array('request.before_send' => 'onBeforeSend');
}

public function onBeforeSend(Event $event)
{
$url = $event['request']->getUrl(true);

$origionalQuery = $url->getQuery();
$newQuery = clone $origionalQuery;

$newQuery->set('api_key', $this->token->getApiToken());

$event['request']->setUrl($url->setQuery($newQuery));
}
}
19 changes: 19 additions & 0 deletions lib/Tmdb/HttpClient/Plugin/ApiTokenPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* This file is part of the Wrike PHP API created by B-Found IM&S.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Wrike
* @author Michael Roterman <[email protected]>
* @copyright (c) 2013, B-Found Internet Marketing & Services
* @version 0.0.1
*/

namespace Tmdb\HttpClient\Plugin;


class ApiTokenPlugin {

}

0 comments on commit 710fa72

Please sign in to comment.