定制 aso824/octoprint-php-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

aso824/octoprint-php-api

最新稳定版本:v0.1.3

Composer 安装命令:

composer require aso824/octoprint-php-api

包简介

OctoPrint API client written in PHP

README 文档

README

API wrapper to allow easy use of OctoPrint REST API in your PHP appplication.

Please note that library is currently in WIP status.

Requirements

  • PHP ^7.4
  • Symfony Serializer ^5.0
  • Any PSR-18 compatible HTTP client (consider using HTTPlug)
  • OctoPrint ^1.4

Installation

composer require aso824/octoprint-php-api

Usage

This simple example below assumes that you are using HTTPlug and have any compatible HTTP client.

use Http\Discovery\HttpClientDiscovery;
use aso824\OctoPrintPHP\Client;
use aso824\OctoPrintPHP\Configuration;

$httpClient = HttpClientDiscovery::find();

$configuration = new Configuration('http://octoprint.local', 'your-api-key');  
$octoClient = new Client($configuration, $httpClient);

var_dump($octoClient->getVersion()->getServer()); // "1.4.2"

$file = $octoClient->files->getFile('test.gcode');
var_dump($file->getGcodeAnalysis()->getEstimatedPrintTime()); // 10120 (seconds)

For list of available action please visit OctoPrint REST API documentation.

Currently implemented endpoints

API resource Status
Connection ✔️
Files ✅ Without upload
Jobs
Languages
Log files
Printer operations
Printer profiles
Settings
Slicing
System
Timelapse
Access control
Util

Contributing

All pull requests are welcome. Please follow same convention as in already existing files.

License

This library is under MIT license.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固