Skip to content

Commit 606c2c4

Browse files
committed
Adding log functionality, and update README.md
1 parent 29ccdee commit 606c2c4

File tree

9 files changed

+27
-14
lines changed

9 files changed

+27
-14
lines changed

.gitignore

100644100755
File mode changed.

DependencyInjection/Configuration.php

100644100755
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public function getConfigTreeBuilder()
2929
->scalarNode('path')->end()
3030
->end()
3131
->end()
32+
->arrayNode('log')
33+
->children()
34+
->scalarNode('enabled')->end()
35+
->scalarNode('path')->end()
36+
->end()
37+
->end()
3238
->end()
3339
;
3440

DependencyInjection/WtfzTmdbExtension.php

100644100755
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,13 @@ public function load(array $configs, ContainerBuilder $container)
4040
$container->setParameter('wtfz_tmdb.cache.enabled', $cacheEnabled);
4141
$container->setParameter('wtfz_tmdb.cache.path', $cachePath);
4242
}
43+
44+
if (array_key_exists('log', $config)) {
45+
$logEnabled = array_key_exists('enabled', $config['log']) && $config['log']['enabled'];
46+
$logPath = array_key_exists('path', $config['log']) ? $config['log']['path'] : null;
47+
48+
$container->setParameter('wtfz_tmdb.log.enabled', $logEnabled);
49+
$container->setParameter('wtfz_tmdb.log.path', $logPath);
50+
}
4351
}
4452
}

LICENSE

100644100755
File mode changed.

README.md

100644100755
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Description
22
----------------
3+
34
A Symfony2 Bundle for use together with the [wtfzdotnet/php-tmdb-api](https://github.com/wtfzdotnet/php-tmdb-api) TMDB Wrapper.
45

56
Status
67
----------------
78

8-
Underlying library is still progressing towards stable, however most things should already be functional.
9-
Please review the state as described in the [README.md](https://github.com/wtfzdotnet/php-tmdb-api/blob/develop/README.md) of [wtfzdotnet/php-tmdb-api](https://github.com/wtfzdotnet/php-tmdb-api/blob/develop/README.md).
9+
Underlying library is as good as stable, currently in last review.
1010

1111
Configuration
1212
----------------
@@ -30,6 +30,10 @@ wtfz_tmdb:
3030
cache:
3131
enabled: true
3232
path: "/tmp/php-tmdb-api"
33+
34+
log:
35+
enabled: true
36+
path: "/tmp/php-tmdb-api.log"
3337
```
3438
3539
__There will be adult and language filters coming in a later stage, so later on the configuration will look like:__
@@ -41,26 +45,16 @@ wtfz_tmdb:
4145
language: nl
4246
```
4347
44-
__Also overriding repositories will be possible later on:__
45-
46-
```yaml
47-
wtfz_tmdb:
48-
api_key: YOUR_API_KEY_HERE
49-
repositories:
50-
movie_repository:
51-
class: "MyBundle\Repository\MovieRepository
52-
```
53-
5448
Usage
5549
----------------
5650
57-
Grabbing the client
51+
Obtaining the client
5852
5953
```php
6054
$client = $this->get('wtfz_tmdb.client');
6155
```
6256

63-
Grabbing repositories
57+
Obtaining repositories
6458

6559
```php
6660
$movie = $this->get('wtfz_tmdb.movie_repository')->load(13);

Resources/config/tmdb.xml

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
<argument>%wtfz_tmdb.cache.enabled%</argument>
4949
<argument>%wtfz_tmdb.cache.path%</argument>
5050
</call>
51+
52+
<call method="setLogging">
53+
<argument>%wtfz_tmdb.log.enabled%</argument>
54+
<argument>%wtfz_tmdb.log.path%</argument>
55+
</call>
5156
</service>
5257

5358
<service id="wtfz_tmdb.api_token" class="%wtfz_tmdb.api_token.class%">

Twig/WtfzTmdbExtension.php

100644100755
File mode changed.

WtfzTmdbBundle.php

100644100755
File mode changed.

composer.json

100644100755
File mode changed.

0 commit comments

Comments
 (0)