Skip to content

Commit b9a3351

Browse files
authored
Merge pull request #9 from hmerritt/release/v1.1.7
Release/v1.1.7
2 parents 4e9ff99 + de73faa commit b9a3351

File tree

11 files changed

+4036
-80
lines changed

11 files changed

+4036
-80
lines changed

.circleci/config.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# PHP CircleCI 2.0 configuration file
2+
# See: https://circleci.com/docs/2.0/language-php/
3+
version: 2
4+
5+
# Define a job to be invoked later in a workflow.
6+
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
7+
jobs:
8+
test:
9+
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
10+
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
11+
docker:
12+
# Specify the version you desire here
13+
- image: cimg/php:8.1.2
14+
15+
# Add steps to the job
16+
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
17+
steps:
18+
- checkout
19+
20+
# Download and cache dependencies
21+
- restore_cache:
22+
keys:
23+
# "composer.lock" can be used if it is committed to the repo
24+
- v1-dependencies-{{ checksum "composer.lock" }}
25+
# fallback to using the latest cache if no exact match is found
26+
- v1-dependencies-
27+
28+
- run:
29+
name: Setup & install dependencies
30+
command: |
31+
composer install --no-interaction
32+
33+
- run:
34+
name: Enable PCOV, disable Xdebug
35+
command: |
36+
mkdir -p ./build/logs
37+
sudo pecl install pcov
38+
39+
- run:
40+
name: Tests
41+
command: |
42+
composer test
43+
# php ./vendor/bin/php-coveralls -v
44+
45+
workflows:
46+
version: 2
47+
test:
48+
jobs:
49+
- test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
vendor/*
22
build/*
33
src/cache/*
4-
composer.lock
4+
.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
# PHP IMDB API
22

33
[![Latest Stable Version](https://poser.pugx.org/hmerritt/imdb-api/v/stable)](https://packagist.org/packages/hmerritt/imdb-api)
4-
[![Build Status](https://travis-ci.org/hmerritt/php-imdb-api.svg?branch=master)](https://travis-ci.org/hmerritt/php-imdb-api)
4+
[![CircleCI](https://circleci.com/gh/hmerritt/php-imdb-api/tree/master.svg?style=svg)](https://circleci.com/gh/hmerritt/php-imdb-api/tree/master)
55
[![Coverage Status](https://coveralls.io/repos/github/hmerritt/php-imdb-api/badge.svg?branch=master)](https://coveralls.io/github/hmerritt/php-imdb-api?branch=master)
66

77
PHP IMDB-API that can fetch film data and search results.
88

9-
10-
11-
129
## Install
10+
1311
Install the latest version using [composer](https://getcomposer.org/).
1412

1513
```
1614
$ composer require hmerritt/imdb-api
1715
```
1816

19-
20-
21-
2217
## Usage
18+
2319
```php
2420
// Assuming you installed from Composer:
2521
require "vendor/autoload.php";
@@ -36,15 +32,14 @@ $imdb->search("Apocalypse");
3632
$imdb->film("tt0816692");
3733
```
3834

39-
4035
### Options
4136

42-
| Name | Type | Default Value | Description |
43-
|--------------- |-------- |--------------------------------------- |----------------------------------------------------------------------------------------------- |
44-
| `curlHeaders` | array | `['Accept-Language: en-US,en;q=0.5']` | Custom headers can be passed to `cURL` when fetching the IMDB page |
45-
| `cache` | bool | `true` | Caches film data to speed-up future requests for the same film |
46-
| `techSpecs` | bool | `true` | Loads a films technical specifications (this will take longer as it makes a separate request) |
47-
| `category` | string | `all` | What category to search for (films `tt`, people `nm` or companies `co`) |
37+
| Name | Type | Default Value | Description |
38+
| ------------- | ------ | ------------------------------------- | --------------------------------------------------------------------------------------------- |
39+
| `curlHeaders` | array | `['Accept-Language: en-US,en;q=0.5']` | Custom headers can be passed to `cURL` when fetching the IMDB page |
40+
| `cache` | bool | `true` | Caches film data to speed-up future requests for the same film |
41+
| `techSpecs` | bool | `true` | Loads a films technical specifications (this will take longer as it makes a separate request) |
42+
| `category` | string | `all` | What category to search for (films `tt`, people `nm` or companies `co`) |
4843

4944
```php
5045
$imdb = new Imdb;
@@ -63,8 +58,8 @@ $imdb->search("Interstellar", [
6358
]);
6459
```
6560

66-
6761
### Best Match
62+
6863
If you do not know the imdb-id of a film, a search string can be entered. This will search imdb and use the first result as the film to fetch data for.
6964

7065
> Note that this will take longer than just entering the ID as it needs to first search imdb before it can get the film data.
@@ -75,31 +70,33 @@ If you do not know the imdb-id of a film, a search string can be entered. This w
7570
$imdb->film("Apocalypse");
7671
```
7772

78-
79-
80-
8173
## Features
8274

8375
### Film Data
76+
8477
```
8578
- Title
79+
- Genres
8680
- Year
87-
- Rating
88-
- Poster
8981
- Length
9082
- Plot
83+
- Rating
84+
- Rating Votes (# of votes)
85+
- Poster
9186
- Trailer
9287
- id
9388
- link
9489
- Cast
9590
- actor name
9691
- actor id
97-
- image
92+
- character
93+
- avatar
94+
- avatar_hq (high quality avatar)
9895
- Technical Specs
9996
```
10097

101-
10298
### Search
99+
103100
Search IMDB to return an array of films, people and companies
104101

105102
```
@@ -117,11 +114,9 @@ Search IMDB to return an array of films, people and companies
117114
- image
118115
```
119116

120-
121-
122-
123117
## Dependencies
118+
124119
> All dependencies are managed automatically by `composer`.
125120
126-
- [php-html-parser](https://github.com/paquettg/php-html-parser)
127-
- [filebase](https://github.com/tmarois/Filebase)
121+
- [php-html-parser](https://github.com/paquettg/php-html-parser)
122+
- [filebase](https://github.com/tmarois/Filebase)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"tmarois/filebase": "^1.0"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "9.0",
20-
"php-coveralls/php-coveralls": "^2.2"
19+
"phpunit/phpunit": "9.5.16",
20+
"php-coveralls/php-coveralls": "2.5.2"
2121
},
2222
"scripts": {
2323
"test": "php vendor/phpunit/phpunit/phpunit"

0 commit comments

Comments
 (0)