tomnomnom/etherpad-lite-client

PHP 的 Etherpad Lite 客户端

0.1.2 2016-02-09 14:27 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:20:27 UTC


README

这个 PHP Etherpad Lite 类允许您轻松使用 PHP 与 Etherpad Lite API 交互。
Etherpad Lite 是由 Etherpad 基金会提供的一个协作编辑器(http://etherpad.org

基本用法

从 Packagist 安装

composer require tomnomnom/etherpad-lite-client

包括一个遗留的 etherpad-lite-client.php 文件,供那些不愿意/无法切换到新命名空间版本的人使用,但该文件已弃用,将在未来的版本中删除。

<?php
require 'vendor/autoload.php';
$instance = new EtherpadLite\Client('EtherpadFTW', 'http://beta.etherpad.org/api');
$revisionCount = $instance->getRevisionsCount('testPad');
$revisionCount = $revisionCount->revisions;
echo "Pad has $revisionCount revisions";

运行测试

通过运行 make test 可以运行全栈测试。

测试套件做了以下假设

  • Etherpad 的副本正在 https://:9001 运行
  • 运行实例中的数据可以被销毁
  • 运行实例的 APIKey 为 'dcf118bfc58cc69cdf3ae870071f97149924f5f5a9a4a552fd2921b40830aaae'
  • PHPUnit 已通过 Composer 安装(运行 make dev-deps

tools/testcontainer 中提供了一个 Dockerfile,以便简化测试实例的设置。

许可证

Apache 许可证

其他事项

Etherpad 基金会还提供了一个 jQuery 插件,用于 Etherpad Lite。
可以在 http://etherpad.org/2011/08/14/etherpad-lite-jquery-plugin/ 找到。