Skip to content

Commit 48b31c5

Browse files
authored
Merge pull request #14 from 0x46616c6b/etherpad-1.7.5
Add compatibility Etherpad Lite API 1.3.0
2 parents a43772d + e57de32 commit 48b31c5

File tree

6 files changed

+4
-142
lines changed

6 files changed

+4
-142
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ jobs:
44
build:
55
docker:
66
- image: circleci/php:7.1
7-
- image: systemli/etherpad-lite:1.6.1
7+
- image: systemli/etherpad-lite:1.7.5
88
steps:
99
- checkout
1010
- run: sudo composer self-update
1111
- restore_cache:
1212
keys:
1313
- composer-{{ checksum "composer.lock" }}
14-
- run: composer install -n --prefer-dist
14+
- run: composer install
1515
- save_cache:
1616
key: composer-{{ checksum "composer.lock" }}
1717
paths:
@@ -21,7 +21,7 @@ jobs:
2121
command: vendor/bin/phpunit
2222
- run:
2323
name: Wait for Etherpad
24-
command: dockerize -wait tcp://localhost:9001 -timeout 1m
24+
command: dockerize -wait http://localhost:9001 -timeout 1m
2525
- run:
2626
name: Running Behat
2727
command: vendor/bin/behat -f progress

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This package provides an easy access to [Etherpad Lite](https://github.com/ether/etherpad-lite) throw there built-in [HTTP API](http://etherpad.org/doc/v1.2.11/#index_http_api).
66

7-
**Supported API Version: 1.2.13 (Release: 1.6.1)**
7+
**Supported API Version: 1.3.0 (Release: 1.7.5)**
88

99
## Installation
1010

features/Chat.feature

-11
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,3 @@ Feature: Chat API
1919
Then the code should be "0"
2020
And the message should be "ok"
2121
And the data should contain "chatHead"
22-
23-
Scenario: Get the chat head for a pad
24-
Given a pad "pad" exists
25-
And an author "author" exists
26-
27-
When I call "appendChatMessage" with params:
28-
| padID | {{ padID }} |
29-
| text | text |
30-
| authorID | {{ authorID }} |
31-
Then the code should be "0"
32-
And the message should be "ok"

features/Pad.feature

-68
Original file line numberDiff line numberDiff line change
@@ -38,49 +38,6 @@ Feature: Pad API
3838
And the message should be "ok"
3939
And the data should contain "revisions"
4040

41-
Scenario: Get saved revisions from a non existing pad
42-
When I call "getSavedRevisionsCount" with params:
43-
| padID | pad |
44-
Then the code should be "1"
45-
And the message should be "padID does not exist"
46-
47-
Scenario: Get saved revisions from a pad
48-
Given a pad "new_pad" exists
49-
50-
When I call "getSavedRevisionsCount" with params:
51-
| padID | {{ padID }} |
52-
Then the code should be "0"
53-
And the message should be "ok"
54-
And the data should contain "savedRevisions"
55-
56-
Scenario: List saved revisions from a non existing pad
57-
When I call "listSavedRevisions" with params:
58-
| padID | pad |
59-
Then the code should be "1"
60-
And the message should be "padID does not exist"
61-
62-
Scenario: List saved revisions from a pad
63-
Given a pad "new_pad" exists
64-
When I call "listSavedRevisions" with params:
65-
| padID | {{ padID }} |
66-
Then the code should be "0"
67-
And the message should be "ok"
68-
And the data should contain "savedRevisions"
69-
70-
Scenario: Save revision for a non existing pad
71-
When I call "saveRevision" with params:
72-
| padID | pad |
73-
Then the code should be "1"
74-
And the message should be "padID does not exist"
75-
76-
Scenario: Save revision for a pad
77-
Given a pad "new_pad" exists
78-
79-
When I call "saveRevision" with params:
80-
| padID | {{ padID }} |
81-
Then the code should be "0"
82-
And the message should be "ok"
83-
8441
Scenario: Get current editing user count for a non existing pad
8542
When I call "padUsersCount" with params:
8643
| padID | pad |
@@ -127,22 +84,6 @@ Feature: Pad API
12784
Then the code should be "0"
12885
And the message should be "ok"
12986

130-
Scenario: Move a non existing pad
131-
When I call "movePad" with params:
132-
| sourceID | pad1 |
133-
| destinationID | pad2 |
134-
Then the code should be "1"
135-
And the message should be "padID does not exist"
136-
137-
Scenario: Move a pad
138-
Given a pad "pad1" exists
139-
140-
When I call "movePad" with params:
141-
| sourceID | {{ padID }} |
142-
| destinationID | pad2 |
143-
Then the code should be "0"
144-
And the message should be "ok"
145-
14687
Scenario: Get readonly id for a non existing pad
14788
When I call "getReadOnlyID" with params:
14889
| padID | pad |
@@ -158,15 +99,6 @@ Feature: Pad API
15899
And the message should be "ok"
159100
And the data should contain "readOnlyID"
160101

161-
# Scenario: Get pad id from a readonly pad
162-
# Given a readonly pad
163-
#
164-
# When I call "getPadID" with params:
165-
# | readOnlyID | {{ readOnlyID }} |
166-
# Then the code should be "0"
167-
# And the message should be "ok"
168-
# And the data should contain "padID"
169-
170102
Scenario: Set public status for a pad
171103
Given a group pad exists
172104

features/PadContent.feature

-35
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ Feature: PadContent API
2121
Then the code should be "0"
2222
And the message should be "ok"
2323

24-
Scenario: Append text for a pad
25-
Given a pad "pad" exists
26-
27-
When I call "appendText" with params:
28-
| padID | {{ padID }} |
29-
| text | text |
30-
Then the code should be "0"
31-
And the message should be "ok"
32-
3324
Scenario: Get html for a pad
3425
Given a pad "pad" exists
3526

@@ -38,29 +29,3 @@ Feature: PadContent API
3829
Then the code should be "0"
3930
And the message should be "ok"
4031
And the data should contain "html"
41-
42-
# Scenario: Set html for a pad
43-
# Given a pad "pad" exists
44-
#
45-
# When I call "setHTML" with params:
46-
# | padID | {{ padID }} |
47-
# | html | html |
48-
# Then the code should be "0"
49-
# And the message should be "ok"
50-
51-
Scenario: Get attribute pool for a pad
52-
Given a pad "pad" exists
53-
54-
When I call "getAttributePool" with params:
55-
| padID | {{ padID }} |
56-
Then the code should be "0"
57-
And the message should be "ok"
58-
And the data should contain "pool"
59-
60-
Scenario: Get revision changeset for a pad
61-
Given a pad "pad" exists
62-
63-
When I call "getRevisionChangeset" with params:
64-
| padID | {{ padID }} |
65-
Then the code should be "0"
66-
And the message should be "ok"

src/EtherpadLite/Client.php

-24
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,17 @@
2929
*
3030
* @method Response getText($padID, $rev = null) returns the text of a pad
3131
* @method Response setText($padID, $text) sets the text of a pad
32-
* @method Response appendText($padID, $text) appends text to a pad
3332
* @method Response getHTML($padID, $rev = null) returns the text of a pad formatted as HTML
34-
* @method Response setHTML($padID, $html) sets the html of a pad
35-
* @method Response getAttributePool($padID) returns the attribute pool of a pad
36-
* @method Response getRevisionChangeset($padID, $revision = null) get the changeset at a given revision, or last revision if 'rev' is not defined.
37-
* @method Response createDiffHTML($padID, $startRev, $endRev) returns an object of diffs from 2 points in a pad
38-
* @method Response restoreRevision($padID, $revision) restores revision from past as new changeset
3933
*
4034
* @method Response getChatHistory($padID, $start = null, $end = null) a part of the chat history, when start and end are given, the whole chat histroy, when no extra parameters are given
4135
* @method Response getChatHead($padID) returns the chatHead (last number of the last chat-message) of the pad
42-
* @method Response appendChatMessage($padID, $text, $authorID, $time = null) creates a chat message, saves it to the database and sends it to all connected clients of this pad
4336
*
4437
* @method Response createPad($padID, $text = null) creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad.
4538
* @method Response getRevisionsCount($padID) returns the number of revisions of this pad
46-
* @method Response getSavedRevisionsCount($padID) returns the number of saved revisions of this pad
47-
* @method Response listSavedRevisions($padID) returns a list of saved revisions of this pad
48-
* @method Response saveRevision($padID, $revision = null) save a revision of a pad
4939
* @method Response padUsersCount($padID) returns the number of user that are currently editing this pad
5040
* @method Response padUsers($padID) returns the list of users that are currently editing this pad
5141
* @method Response deletePad($padID) deletes a pad
52-
* @method Response movePad($sourceID, $destinationID, $force = false) moves a pad. If force is true and the destination pad exists, it will be overwritten.
53-
* @method Response copyPad($sourceID, $destinationID, $force = false) copies a pad with full history and chat. If force is true and the destination pad exists, it will be overwritten.
5442
* @method Response getReadOnlyID($padID) returns the read only link of a pad
55-
* @method Response getPadID($readOnlyID) returns the id of a pad which is assigned to the readOnlyID
5643
* @method Response setPublicStatus($padID, $publicStatus) sets a boolean for the public status of a pad
5744
* @method Response getPublicStatus($padID) return true of false
5845
* @method Response setPassword($padID, $password) returns ok or a error message
@@ -148,28 +135,17 @@ public static function getMethods(): array
148135
'listSessionsOfAuthor' => ['authorID'],
149136
'getText' => ['padID', 'rev'],
150137
'setText' => ['padID', 'text'],
151-
'appendText' => ['padID', 'text'],
152138
'getHTML' => ['padID', 'rev'],
153-
'setHTML' => ['padID', 'html'],
154139
'getAttributePool' => ['padID'],
155-
'createDiffHTML' => ['padID', 'startRev', 'endRev'],
156-
'restoreRevision' => ['padID', 'rev'],
157-
'getRevisionChangeset' => ['padID'],
158140
'getChatHistory' => ['padID', 'start', 'end'],
159141
'getChatHead' => ['padID'],
160-
'appendChatMessage' => ['padID', 'text', 'authorID'],
161142
'createPad' => ['padID', 'text'],
162143
'getRevisionsCount' => ['padID'],
163-
'getSavedRevisionsCount' => ['padID'],
164144
'listSavedRevisions' => ['padID'],
165-
'saveRevision' => ['padID'],
166145
'padUsersCount' => ['padID'],
167146
'padUsers' => ['padID'],
168147
'deletePad' => ['padID'],
169-
'movePad' => ['sourceID', 'destinationID'],
170-
'copyPad' => ['sourceID', 'destinationID'],
171148
'getReadOnlyID' => ['padID'],
172-
'getPadID' => ['readOnlyID'],
173149
'setPublicStatus' => ['padID', 'publicStatus'],
174150
'getPublicStatus' => ['padID'],
175151
'setPassword' => ['padID', 'password'],

0 commit comments

Comments
 (0)