Skip to content

Commit 87e546e

Browse files
committed
Initial commit of the Laravel package.
0 parents  commit 87e546e

File tree

11 files changed

+468
-0
lines changed

11 files changed

+468
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
composer.phar
3+
composer.lock
4+
.DS_Store

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
- 5.5
7+
- 5.6
8+
- hhvm
9+
10+
before_script:
11+
- composer self-update
12+
- composer install --prefer-source --no-interaction --dev
13+
14+
script: phpunit

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Description
2+
----------------
3+
4+
A Laraval Package for use together with the [wtfzdotnet/php-tmdb-api](https://github.com/wtfzdotnet/php-tmdb-api) TMDB Wrapper.
5+
6+
Configuration
7+
----------------
8+
Add to your `app/config/app.php` the service provider:
9+
10+
```php
11+
// Provider
12+
'providers' => array(
13+
'Wtfz\TmdbPackage\TmdbServiceProvider',
14+
)
15+
```
16+
17+
Then publish the configuration file:
18+
19+
```
20+
php artisan config:publish wtfz/tmdb
21+
```
22+
23+
And modify the configuration file located at `app/config/packages/wtfz/tmdb/config.php` accordingly.
24+
25+
That's all! Fire away!
26+
27+
Usage
28+
----------------
29+
30+
Obtaining the RAW data
31+
32+
```php
33+
$client = Tmdb::getMoviesApi()->load(13);
34+
```
35+
36+
Obtaining modeled data
37+
38+
```php
39+
$movie = Tmdb::getMovieRepository()->load(13);
40+
```
41+
42+
**For all all other interactions take a look at [wtfzdotnet/php-tmdb-api](https://github.com/wtfzdotnet/php-tmdb-api).**

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "wtfzdotnet/tmdb-package",
3+
"description": "Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.",
4+
"authors": [
5+
{
6+
"name": "Michael Roterman",
7+
"email": "michael@wtfz.net"
8+
}
9+
],
10+
"require": {
11+
"php": ">=5.4.0",
12+
"illuminate/support": "4.2.*",
13+
"wtfzdotnet/php-tmdb-api": "~1.1"
14+
},
15+
"require-dev": {
16+
"doctrine/cache": ">=1.3.0",
17+
"monolog/monolog": ">=1.7.0"
18+
},
19+
"suggest": {
20+
"doctrine/cache": "Required if you want to make use of caching features.",
21+
"monolog/monolog": "Required if you want to make use of logging features."
22+
},
23+
"autoload": {
24+
"psr-0": {
25+
"Wtfz\\TmdbPackage\\": "src/"
26+
}
27+
},
28+
"minimum-stability": "stable"
29+
}

phpunit.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Package Test Suite">
15+
<directory suffix=".php">./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* @package Wtfz_TmdbPackage
4+
* @author Michael Roterman <michael@wtfz.net>
5+
* @copyright (c) 2014, Michael Roterman
6+
*/
7+
namespace Wtfz\TmdbPackage\Facades;
8+
9+
use Illuminate\Support\Facades\Facade;
10+
11+
class Tmdb extends Facade {
12+
13+
/**
14+
* Get the registered name of the component.
15+
*
16+
* @return string
17+
*/
18+
protected static function getFacadeAccessor() { return 'Tmdb'; }
19+
20+
}

src/Wtfz/TmdbPackage/Tmdb.php

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
<?php
2+
/**
3+
* @package Wtfz_TmdbPackage
4+
* @author Michael Roterman <michael@wtfz.net>
5+
* @copyright (c) 2014, Michael Roterman
6+
*/
7+
namespace Wtfz\TmdbPackage;
8+
9+
use Tmdb\Client as TmdbClient;
10+
use Tmdb\Repository\AccountRepository;
11+
use Tmdb\Repository\AuthenticationRepository;
12+
use Tmdb\Repository\CertificationRepository;
13+
use Tmdb\Repository\ChangesRepository;
14+
use Tmdb\Repository\CollectionRepository;
15+
use Tmdb\Repository\CompanyRepository;
16+
use Tmdb\Repository\ConfigurationRepository;
17+
use Tmdb\Repository\CreditsRepository;
18+
use Tmdb\Repository\DiscoverRepository;
19+
use Tmdb\Repository\FindRepository;
20+
use Tmdb\Repository\GenreRepository;
21+
use Tmdb\Repository\GuestSessionRepository;
22+
use Tmdb\Repository\JobsRepository;
23+
use Tmdb\Repository\KeywordRepository;
24+
use Tmdb\Repository\ListRepository;
25+
use Tmdb\Repository\MovieRepository;
26+
use Tmdb\Repository\NetworkRepository;
27+
use Tmdb\Repository\PeopleRepository;
28+
use Tmdb\Repository\ReviewRepository;
29+
use Tmdb\Repository\SearchRepository;
30+
use Tmdb\Repository\TimezoneRepository;
31+
use Tmdb\Repository\TvEpisodeRepository;
32+
use Tmdb\Repository\TvRepository;
33+
use Tmdb\Repository\TvSeasonRepository;
34+
35+
class Tmdb extends TmdbClient {
36+
/**
37+
* @return AccountRepository
38+
*/
39+
public function getAccountRepository()
40+
{
41+
return new AccountRepository($this);
42+
}
43+
44+
/**
45+
* @return AuthenticationRepository
46+
*/
47+
public function getAuthenticationRepository()
48+
{
49+
return new AuthenticationRepository($this);
50+
}
51+
52+
/**
53+
* @return CertificationRepository
54+
*/
55+
public function getCertificationRepository()
56+
{
57+
return new CertificationRepository($this);
58+
}
59+
60+
/**
61+
* @return ChangesRepository
62+
*/
63+
public function getChangesRepository()
64+
{
65+
return new ChangesRepository($this);
66+
}
67+
68+
/**
69+
* @return CollectionRepository
70+
*/
71+
public function getCollectionRepository()
72+
{
73+
return new CollectionRepository($this);
74+
}
75+
76+
/**
77+
* @return CompanyRepository
78+
*/
79+
public function getCompanyRepository()
80+
{
81+
return new CompanyRepository($this);
82+
}
83+
84+
/**
85+
* @return ConfigurationRepository
86+
*/
87+
public function getConfigurationRepository()
88+
{
89+
return new ConfigurationRepository($this);
90+
}
91+
92+
/**
93+
* @return CreditsRepository
94+
*/
95+
public function getCreditsRepository()
96+
{
97+
return new CreditsRepository($this);
98+
}
99+
100+
/**
101+
* @return DiscoverRepository
102+
*/
103+
public function getDiscoverRepository()
104+
{
105+
return new DiscoverRepository($this);
106+
}
107+
108+
/**
109+
* @return FindRepository
110+
*/
111+
public function getFindRepository()
112+
{
113+
return new FindRepository($this);
114+
}
115+
116+
/**
117+
* @return GenreRepository
118+
*/
119+
public function getGenreRepository()
120+
{
121+
return new GenreRepository($this);
122+
}
123+
124+
/**
125+
* @return GuestSessionRepository
126+
*/
127+
public function getGuestSessionRepository()
128+
{
129+
return new GuestSessionRepository($this);
130+
}
131+
132+
/**
133+
* @return JobsRepository
134+
*/
135+
public function getJobsRepository()
136+
{
137+
return new JobsRepository($this);
138+
}
139+
140+
/**
141+
* @return KeywordRepository
142+
*/
143+
public function getKeywordRepository()
144+
{
145+
return new KeywordRepository($this);
146+
}
147+
148+
/**
149+
* @return ListRepository
150+
*/
151+
public function getListRepository()
152+
{
153+
return new ListRepository($this);
154+
}
155+
156+
/**
157+
* @return MovieRepository
158+
*/
159+
public function getMovieRepository()
160+
{
161+
return new MovieRepository($this);
162+
}
163+
164+
/**
165+
* @return NetworkRepository
166+
*/
167+
public function getNetworkRepository()
168+
{
169+
return new NetworkRepository($this);
170+
}
171+
172+
/**
173+
* @return PeopleRepository
174+
*/
175+
public function getPeopleRepository()
176+
{
177+
return new PeopleRepository($this);
178+
}
179+
180+
/**
181+
* @return ReviewRepository
182+
*/
183+
public function ReviewRepository()
184+
{
185+
return new ReviewRepository($this);
186+
}
187+
188+
/**
189+
* @return SearchRepository
190+
*/
191+
public function SearchRepository()
192+
{
193+
return new SearchRepository($this);
194+
}
195+
196+
/**
197+
* @return TimezoneRepository
198+
*/
199+
public function getTimezoneRepository()
200+
{
201+
return new TimezoneRepository($this);
202+
}
203+
204+
/**
205+
* @return TvEpisodeRepository
206+
*/
207+
public function getTvEpisodeRepository()
208+
{
209+
return new TvEpisodeRepository($this);
210+
}
211+
212+
/**
213+
* @return TvRepository
214+
*/
215+
public function getTvRepository()
216+
{
217+
return new TvRepository($this);
218+
}
219+
220+
/**
221+
* @return TvSeasonRepository
222+
*/
223+
public function getTvSeasonRepository()
224+
{
225+
return new TvSeasonRepository($this);
226+
}
227+
}

0 commit comments

Comments
 (0)