承接 mlntn/fpl-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mlntn/fpl-api

Composer 安装命令:

composer require mlntn/fpl-api

包简介

Fantasy Premier League API

README 文档

README

Requires omni-cache

Installation

Use composer:

{
  "require": {
    "mlntn/fpl-api": "*",
    "mlntn/omni-cache": "*"
  },
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/mlntn/fpl-api"
    },
    {
      "type": "git",
      "url": "https://github.com/mlntn/omni-cache"
    }
  ]
}

Write a controller:

<?php
$autoloader = require 'vendor/autoload.php';
$api = new Fpl\Api(new Cache\Provider\File('./cache', 86400));

$player = $api->getPlayer(323);
die(json_encode($player));

// prettier with this:
// json_encode($player, JSON_PRETTY_PRINT ^ JSON_UNESCAPED_UNICODE ^ JSON_UNESCAPED_SLASHES)

What does all that code above do?

The composer.json settings tell Composer to include this API and a caching tool I wrote called omni-cache.

The PHP controller sets up the autoloader, starts up a cache handler that caches to files for a maximum of 1 day, starts up the API class (passing in the cache handler) and grabs some player data (Artur Boruc) from fantasy.premierleague.com.

Check out Fpl\Api.php for other API methods.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固