承接 nivshah/discourse-api-php 相关项目开发

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

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

nivshah/discourse-api-php

Composer 安装命令:

composer require nivshah/discourse-api-php

包简介

Discourse API library for PHP

README 文档

README

This is a composer packaged version of the PHP library for accessing the Discourse API.

More about Discourse: https://www.discourse.org/

Discourse API docs: https://docs.discourse.org/

Features

  • Supports header-based authentication (required by Discourse as of April 2020)
  • Includes test suite for developers

Changelog

  • 2.1 - Fixing a nasty little bug

History

Originally as published by DiscourseHosting at https://github.com/discoursehosting/discourse-api-php.

With contributions from:

Now lives at https://github.com/nivshah/discourse-api-php

How to Use

Just include it with Composer: composer require nivshah/discourse-api-php

And then:

// set up key in Discourse first - recommend system key for all users
$key = 'my-secret-discourse-api-key';
$hostname = 'forums.example.com';

$api = new \nivshah\DiscourseAPI($hostname, $key);

// and you're off and running!
// look through the src/DiscourseAPI.php file for methods
// for example:
$results = $api->getTopTopics();

// if you aren't sure what the API returns from a call, just look at it:
$results = $api->getUserByDiscourseId( 1 );
var_dump($results);

// you can also get a lot of info from the tests (see tests/DiscourseApiTest.php).

For Developers

I'd love to see your changes and improvements to this library! Please feel free to submit a pull request, and please include a new test if you are adding/refactoring methods.

Testing

Setup

  1. Run composer install to install PHPUnit and other helper libraries
  2. Copy the .env.example file in the tests folder, change the name to .env and fill in the blanks

Running tests

In the terminal, from the root directory of this project, enter: ./vendor/bin/phpunit tests/DiscourseApiTest.php

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固