PHP Classes

How to Build a PHP Movie Database Using the Package The Movie Database Service: Retrieve movie information with the TMDB.com API

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-12-11 (Yesterday) RSS 2.0 feedNot enough user ratingsTotal: 1 This week: 1All time: 11,512 This week: 43Up
Version License PHP version Categories
the-movie-database-s 1.0The PHP License5PHP 5, Web services, Video
Description 

Author

This package can retrieve movie information with the TMDB.com API.

It can send HTTP requests to the TMDB.com API Web server to retrieve several types of information about movies.

Currently, it can retrieve:

- Movie details

- People involved in the movies

- Keywords

- Network

- Reviews

- TV channels

- Collections the movie belongs

Picture of Hicri
  Performance   Level  
Name: Hicri <contact>
Classes: 29 packages by
Country: Turkey Turkey
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Example

<?php

require __DIR__ . '/../vendor/autoload.php';

use
Qwerty\Tmdb\Client;
use
Qwerty\Tmdb\Tmdb;


$option = [
       
'base_url' => "https://api.themoviedb.org/3/movie/550",
       
'api_key' => "b1931f4b871deeec6800ccde48a5f744",
       
'version' => '3'
   
];

$client = new Client($option);
$ext = new Tmdb($client);

//echo $ext->movie("550");
//echo $ext->people("13");
//echo $ext->keyword("550");
//echo $ext->network("550");
//echo $ext->review("58aa82f09251416f92006a3a");
//echo $ext->tv("111");
echo $ext->collection("10");



Details

TMDB service

tests Latest Stable Version Latest Unstable Version License Total Downloads

An api service for tmdb.com

Installation

To install this package tou can use composer:

composer require slvler/tmdb

Usage

  • first step is to start client client with required url, version, api key
    $option['base_url'] = 'https://api.themoviedb.org/3/'
    $option['api_key'] = 'xxxx'
    $option['version'] = '3'
    
    

$client = new Client($option);

- You need to make a request to the tmdb service with the service point we created.

$tmdb = new Tmdb($client);

- Then you can send a request like this to bring the information of the movie we want.

$tmdb->movie("550");

- You can it to fetch player information.

$tmdb->people("13");

- to search on the specified keyword

$tmdb->keyword("550");

- to search in the specified condition

$tmdb->network("550");

- You can it to search in specified situations.

$tmdb->review("58aa82f09251416f92006a3a");

- You want this service when you want a TV program.

$tmdb->tv("111");

-  movies with collection

$tmdb->collection("10");

### Testing

vendor\bin\phpunit

## Credits
- slvler
## License
The MIT License (MIT). Please see License File for more information.

  Files folder image Files (11)  
File Role Description
Files folder image.github (1 directory)
Files folder imageexample (1 file)
Files folder imagesrc (3 files)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (11)  /  .github  
File Role Description
Files folder imageworkflows (2 files)

  Files folder image Files (11)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file php.yml Data Auxiliary data
  Accessible without login Plain text file tests.yml Data Auxiliary data

  Files folder image Files (11)  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files (11)  /  src  
File Role Description
  Plain text file Client.php Class Class source
  Plain text file ClientInterface.php Class Class source
  Plain text file Tmdb.php Class Class source

  Files folder image Files (11)  /  tests  
File Role Description
  Plain text file TmdbAPITest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:1
This week:1
All time:11,512
This week:43Up