Skip to content

Commit 4226cb7

Browse files
author
Artem Stepin
committed
first commit
0 parents  commit 4226cb7

File tree

15 files changed

+3129
-0
lines changed

15 files changed

+3129
-0
lines changed

.github/workflows/quality.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
name: CodeQuality
8+
9+
jobs:
10+
phpstan:
11+
name: PHPStan
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: php-actions/composer@v5
18+
19+
- name: PHPStan Static Analysis
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
php_version: 7.4

.github/workflows/tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: php-actions/composer@v5 # or alternative dependency management
12+
- name: PHPUnit tests
13+
uses: php-actions/phpunit@v3
14+
with:
15+
configuration: phpunit.xml
16+
php_version: 7.4

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Vendor directory
2+
vendor
3+
4+
# Composer PHAR
5+
composer.phar
6+
7+
.idea/
8+
9+
.phpunit.result.cache

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Shawn Tan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Confluence PHP Client
2+
A Confluence RESTful API client in PHP
3+
4+
An Object Oriented wrapper for Confluence
5+
6+
## Requirements
7+
8+
* PHP >= 7.4.0
9+
10+
## Installation
11+
12+
```bash
13+
$ php composer.phar require CloudPlayDev/confluence-php-client
14+
```
15+
16+
## Usage
17+
18+
```php
19+
<?php
20+
declare(strict_types=1);
21+
22+
use CloudPlayDev\ConfluenceClient\Client;
23+
use CloudPlayDev\ConfluenceClient\Curl;
24+
use CloudPlayDev\ConfluenceClient\Entity\ConfluencePage;
25+
26+
//Create and configure a curl web client
27+
$curl = new Curl('confluence_host_url','username','password');
28+
29+
//Create the Confluence Client
30+
$client = new Client($curl);
31+
32+
//Create a confluence page
33+
$page = new ConfluencePage();
34+
35+
//Configure your page
36+
$page->setSpace('testSpaceKey')->setTitle('Test')->setContent('<p>test page</p>');
37+
38+
//Create the page in confluence in the test space
39+
$client->createPage($page);
40+
41+
//Get the page we created
42+
echo $client->selectPageBy([
43+
'spaceKey' => 'testSpaceKey',
44+
'title' => 'Test'
45+
]);
46+
47+
```
48+
49+
50+
### Get your development instance
51+
52+
Atlassian changed the way to work on Confluence/Jira, now in order to create your plugin, you have to get a [Developer Account](http://go.atlassian.com/cloud-dev) and create your own instance. All the steps to create your environment are defined on the [documentation page](https://developer.atlassian.com/static/connect/docs/latest/guides/development-setup.html).
53+
54+
Once you have access to your own Atlassian Cloud instance and you put it in developer mode, we can continue and let the instance contact us.
55+

composer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "CloudPlayDev/confluence-php-client",
3+
"description": "Confluence API PHP Client",
4+
"version": "2.1.3",
5+
"license": "MIT",
6+
"keywords": [
7+
"Atlassian",
8+
"Confluence",
9+
"Authentication",
10+
"PHP",
11+
"Client"
12+
],
13+
"authors": [
14+
{
15+
"name": "Yuxiao (Shawn) Tan",
16+
"email": "yuxiaota@gmail.com"
17+
},
18+
{
19+
"name": "Artem Stepin",
20+
"email": "stepin.artem@gmail.com"
21+
}
22+
],
23+
"minimum-stability": "stable",
24+
"autoload": {
25+
"psr-4": {
26+
"CloudPlayDev\\ConfluenceClient\\": [
27+
"src/",
28+
"tests/"
29+
]
30+
}
31+
},
32+
"require": {
33+
"php": "^7.4",
34+
"ext-curl": "*",
35+
"ext-json": "*"
36+
},
37+
"require-dev": {
38+
"phpunit/phpunit": "^9.5.5",
39+
"phpstan/phpstan": "^0.12.90"
40+
}
41+
}

0 commit comments

Comments
 (0)