weebly / ghost-io-php
PHP的SDK库,简化对ghost.io API的请求。
0.1.4
2018-11-16 22:05 UTC
Requires
- php: >=5.4
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2024-09-15 03:49:51 UTC
README
这个库旨在帮助开发者使用PHP代码与Ghost.io API交互。
特性
- PSR-4自动加载兼容结构
- 使用PHPUnit进行单元测试
- 易于使用的库
安装
我们使用Packagist提供此库,因此更容易将其包含到您的项目中。请确保您的PATH中已安装composer。为此,您可以在终端中运行以下命令:
composer require weebly/ghost-io-php
对于最新的开发版本
"require": { "weebly/ghost-io-php": "master@dev" },
安装或更新您的composer依赖项
composer install
作为最后的检查,您可以查看您的vendor库以查看是否已创建weebly/ghost-io-php文件夹。现在您可以使用它来编写代码了。
使用方法
use GhostIO\GhostIO; $ghost = new GhostIO( 'https://your-blog.ghost.io', // This is the base url for your blog 'example@example.com', // email (username) of the user that will do the API requests 'password', // The user password 'ghost-frontend', // The client id 'the-client-secret' // The client secret ); $res = $ghost->getAllPosts(); // retrieve all posts from the ghost server
可用的客户端方法
以下列表显示了可用的方法以及它们在ghost.io API中代表的路由:
贡献
请阅读CONTRIBUTING.md,了解我们的行为准则和向我们提交拉取请求的流程。
文档
更多文档,请查看以下ghost.io API文档:GhostIO API Docs。
祝您享受!