Skip to content

Commit 217b5ae

Browse files
Bug fixing to support php 7 and set example to get file data
1 parent d15737e commit 217b5ae

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `esign-bsre-php` will be documented in this file
44

5-
## 1.0.0 - 201X-XX-XX
5+
## 1.0.0 - 2022-11-15
66

7-
- initial release
7+
1. Initial release
8+
2. Sign Invisible
9+
3. Verification
10+
11+
## 1.0.1 - 2022-11-22
12+
1. Bug fixing error to support PHP 7
13+
2. Set example to get file data

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ $response->getErrors(); //Get error response
5656
$response->getData(); //Get data as array (tergantung dari API BSrE)
5757
```
5858

59+
### Contoh kode mengambil file
60+
Terdapat berapa cara untuk mengambil file yang terdapat pada aplikasi
61+
62+
- Menggunakan Utils dari GuzzleHttp
63+
```php
64+
$file = GuzzleHttp\Psr7\Utils::tryFopen('/path/to/file.pdf', 'r')
65+
```
66+
67+
- Menggunakan `file_get_contents`
68+
```php
69+
$file = file_get_contents('/path/to/file.pdf')
70+
```
71+
5972
<!--### Testing
6073
6174
```bash

src/ESignBsreResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getErrors()
6363
public function setDataFromResponse(): void
6464
{
6565
if ($this->isSuccess()){
66-
if (str_contains(strtolower(implode(" ", $this->response->getHeader('Content-Type'))), strtolower('application/json')))
66+
if (strpos(strtolower(implode(" ", $this->response->getHeader('Content-Type'))), strtolower('application/json')) !== false)
6767
$this->data = json_decode($this->response->getBody()->getContents());
6868
else
6969
$this->data = $this->response->getBody()->getContents();

0 commit comments

Comments
 (0)