Skip to content

Commit 9bd7d15

Browse files
authored
Release 24.7 (#72)
* Insert example from index.php * Bump version to 24.7
1 parent 8398e8b commit 9bd7d15

File tree

5 files changed

+61
-4
lines changed

5 files changed

+61
-4
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ update:
2222
composer update
2323
composer validate
2424

25+
.PHONY: insert-example
26+
insert-example:
27+
./scripts/insert-example.bash
28+
2529
.PHONY: after-gen
26-
after-gen: format
30+
after-gen: format insert-example
2731
./scripts/add-deprecation-warnings.bash

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/aspose/barcode-cloud-php/php)](https://packagist.org/packages/aspose/barcode-cloud-php)
77

88
- API version: 3.0
9-
- Package version: 24.6.0
9+
- Package version: 24.7.0
1010
- Supported PHP versions: ">=7.4 || >=8.0"
1111

1212
## Demo applications
@@ -47,14 +47,23 @@ require __DIR__ . '/vendor/autoload.php';
4747
### Sample usage
4848

4949
```php
50+
<?php
51+
52+
declare(strict_types=1);
53+
54+
require __DIR__ . '/vendor/autoload.php';
55+
5056
use Aspose\BarCode\Configuration;
5157
use Aspose\BarCode\BarcodeApi;
5258
use Aspose\BarCode\Requests\GetBarcodeGenerateRequest;
5359
use Aspose\BarCode\Model\{EncodeBarcodeType, CodeLocation};
5460

5561
$config = new Configuration();
56-
$config->setClientId('Client Id from https://dashboard.aspose.cloud/applications');
62+
$config->setClientId('ClientId from https://dashboard.aspose.cloud/applications');
5763
$config->setClientSecret('Client Secret from https://dashboard.aspose.cloud/applications');
64+
if (getenv("TEST_CONFIGURATION_ACCESS_TOKEN")) {
65+
$config->setAccessToken(getenv("TEST_CONFIGURATION_ACCESS_TOKEN"));
66+
}
5867

5968
$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test');
6069
$request->format = 'png';
@@ -68,6 +77,7 @@ $size = $response->getSize();
6877
header("Content-Type: $type");
6978
header("Content-Length: $size");
7079
echo $response->fread($size);
80+
7181
```
7282

7383
## Licensing
@@ -194,3 +204,4 @@ Class | Method | HTTP request | Description
194204
- [TextAlignment](docs/Model/TextAlignment.md)
195205
- [FileVersion](docs/Model/FileVersion.md)
196206

207+

scripts/insert-example.bash

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
cd "$( dirname "${BASH_SOURCE[0]}" )/.."
5+
6+
python "./scripts/insert-example.py" "README.template" > "README.md"
7+
8+
rm "README.template"

scripts/insert-example.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import argparse
2+
import os
3+
import re
4+
import typing
5+
6+
REPLACE_RE = re.compile(r'^%insert (?P<file_name>[^%]+)%$', re.MULTILINE)
7+
8+
9+
def read_text(filename: str) -> str:
10+
with open(filename, "rt") as rf:
11+
text = rf.read()
12+
return text
13+
14+
15+
def main(template: typing.TextIO) -> None:
16+
content: str = template.read()
17+
18+
def sub_match(match):
19+
file_name = match.group('file_name')
20+
return read_text(file_name)
21+
22+
text = REPLACE_RE.sub(sub_match, content)
23+
print(text)
24+
25+
26+
def parse_args() -> typing.Dict[str, typing.Any]:
27+
parser = argparse.ArgumentParser()
28+
parser.add_argument("template", type=argparse.FileType("rt"), help="README.template")
29+
kwargs = vars(parser.parse_args())
30+
return kwargs
31+
32+
33+
if __name__ == "__main__":
34+
main(**parse_args())

src/Aspose/BarCode/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Configuration implements JsonSerializable
2020
*
2121
* @var string
2222
*/
23-
protected $clientVersion = '24.6.0';
23+
protected $clientVersion = '24.7.0';
2424

2525
/**
2626
* ClientId for API

0 commit comments

Comments
 (0)