angelxmoreno/cakephp-tmdb-datasource
Composer 安装命令:
composer require angelxmoreno/cakephp-tmdb-datasource
包简介
A CakePHP plugin for connecting to the TMDB API using a Datasource
关键字:
README 文档
README
A CakePHP plugin for accessing the TMDB API via a Datasource.
Plugin purpose
The purpose of this plugin is to provide easy access to the TMDB API for any CakePHP application. Currently the plugin only holds the TMDB datasource but will evolve to include Models, Controllers, Views and Helpers. With the plugin you will be able to create an application with access to an extensive list of movies, actors and all the data provided my the TMDB API.
Requirements
- CakePHP version 2.0
- A TMDB API key - To register for an API key, head into your account page on The Movie Database (tmdb.org)and generate a new key from within the "API Details" section.
Installation & Setup##
Getting the code
Via Submodule
$ cd /your_app_path
$ git submodule add git@github.com:angelxmoreno/CakePHP-TMDB-Datasource.git Plugin/TmdbApi
Via Clone
$ cd /your_app_path/Plugin
$ git git@github.com:angelxmoreno/CakePHP-TMDB-Datasource.git TmdbApi
Via I-don't-use-git-but-I-really-should
* Unzip this plugin into your app/Plugin/ directory
* Rename the folder to `TmdbApi`
###Enable plugin You need to enable the plugin your your_app_path/Config/bootstrap.php file:
CakePlugin::load('TmdbApi');
If you are already using CakePlugin::loadAll();, then this is not necessary.
Database settings
In your your_app_path/Config/database.php add a new entry for the datasource
public $tmdb = array( 'datasource' => 'TmdbApi.TmdbSource', 'apiKey' => 'YOUR-API-KEY', );
Model setup
Create a model and make sure you add the $useDbConfig and $useTable appropriately. The value of $useDbConfig should be the databse.php property that holds your datasource information. The value of $useTable pertains to the TMDB entity you will be accessing via the model. Below is an example:
class TmdbMovie extends AppModel { public $useDbConfig = 'tmdb'; public $useTable = 'movies'; }
Usage
$results = $this->TmdbMovie->read(null, 550); debug($results); $results = $this->TmdbMovie->find('first', array('conditions'=>array( 'query'=>'Terminator', 'append_to_response' => array('images'), ))); debug($results); $results = $this->TmdbMovie->find('all', array('conditions'=>array( 'query'=>'Batman', 'append_to_response' => true,//will auto append all applicable calls ))); debug($results);
Support
For support, bugs and feature requests, please use the issues section of this repository - https://github.com/angelxmoreno/CakePHP-TMDB-Datasource/issues.
Branch strategy
The master branch holds the STABLE latest version of the plugin.
Develop branch is UNSTABLE and used to test new features before releasing them.
Contributing to this Plugin
Please feel free to contribute to the plugin with new issues, requests, unit tests, code fixes or new features. If you choose to contribute, create a feature branch from develop, and send me your pull request. Unit tests for new features and issues detected are highly encourged.
License
Copyright 2013 Angel S. Moreno (angelxmoreno). All rights reserved. Licensed under The MIT License. Redistributions of files must retain the above copyright notice.
Acknowledgments
Thanks to:
Larry Masters and everyone who has contributed to CakePHP.
Travis Bell, founder and lead developer of The Movie Database (TMDb).
angelxmoreno/cakephp-tmdb-datasource 适用场景与选型建议
angelxmoreno/cakephp-tmdb-datasource 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 3, 最近一次更新时间为 2014 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「cakephp」 「datasource」 「movie」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 angelxmoreno/cakephp-tmdb-datasource 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 angelxmoreno/cakephp-tmdb-datasource 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 angelxmoreno/cakephp-tmdb-datasource 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
FSi DataSource Component
FSi DataSource Bundle
MongoDB Datasource for CakePHP
AWS S3 datasource in CakePHP3
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-22