tobiassjosten/thetvdb-bundle

TheTVDB.com API 库的 Symfony2 扩展包

1.0.3 2016-02-28 19:04 UTC

This package is not auto-updated.

Last update: 2024-09-28 13:56:32 UTC


README

此扩展包封装了TheTVDB API 客户端,在Symfony2 服务容器中,使得将优秀的TheTVDB.com 数据库集成到您的 Symfony 应用程序中变得简单。

TheTVDB.com 是一个开放数据库,包含大量电视相关数据和图形,由其成员添加。就像一个具有 API 的利基维基百科!您需要注册 API 密钥才能使用此服务。

TobiassjostenTheTVDBBundle 最初是为在Smartburk.se中使用的。

Build Status

使用方法

1. 使用 Composer 下载扩展包

在您的 composer.json 中添加 TobiassjostenTheTVDBBundle

{
    "require": {
        "tobiassjosten/thetvdb-bundle": "1.0.*"
    }
}

现在运行以下命令让 Composer 下载扩展包

$ php composer.phar update tobiassjosten/thetvdb-bundle

Composer 将将扩展包安装到您的项目的 vendor/tobiassjosten 目录。

2. 启用扩展包

在内核中启用扩展包(app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Tobiassjosten\TheTVDBBundle\TobiassjostenTheTVDBBundle(),
    );
}

3. 配置 API 客户端

将您的 API 密钥添加到应用程序的参数中(app/config/parameters.yml

parameters:
    # ...
    thetvdb_api_key: ABCDEF123456

4. 获取服务

使用依赖注入容器来获取服务

$api = $container->get('thetvdb');

有关如何使用实际 API 的详细信息,请参阅

许可协议

此扩展包受 MIT 许可协议的约束。请参阅扩展包中的完整许可协议。

Resources/meta/LICENSE