diff --git a/Makefile b/Makefile index cb4f6b8..2bdc0b0 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,10 @@ update: composer update composer validate +.PHONY: insert-example +insert-example: + ./scripts/insert-example.bash + .PHONY: after-gen -after-gen: format +after-gen: format insert-example ./scripts/add-deprecation-warnings.bash diff --git a/README.md b/README.md index 8a3a257..879bbba 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/aspose/barcode-cloud-php/php)](https://packagist.org/packages/aspose/barcode-cloud-php) - API version: 3.0 -- Package version: 24.6.0 +- Package version: 24.7.0 - Supported PHP versions: ">=7.4 || >=8.0" ## Demo applications @@ -47,14 +47,23 @@ require __DIR__ . '/vendor/autoload.php'; ### Sample usage ```php +setClientId('Client Id from https://dashboard.aspose.cloud/applications'); +$config->setClientId('ClientId from https://dashboard.aspose.cloud/applications'); $config->setClientSecret('Client Secret from https://dashboard.aspose.cloud/applications'); +if (getenv("TEST_CONFIGURATION_ACCESS_TOKEN")) { + $config->setAccessToken(getenv("TEST_CONFIGURATION_ACCESS_TOKEN")); +} $request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test'); $request->format = 'png'; @@ -68,6 +77,7 @@ $size = $response->getSize(); header("Content-Type: $type"); header("Content-Length: $size"); echo $response->fread($size); + ``` ## Licensing @@ -194,3 +204,4 @@ Class | Method | HTTP request | Description - [TextAlignment](docs/Model/TextAlignment.md) - [FileVersion](docs/Model/FileVersion.md) + diff --git a/scripts/insert-example.bash b/scripts/insert-example.bash new file mode 100755 index 0000000..69afc57 --- /dev/null +++ b/scripts/insert-example.bash @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail + +cd "$( dirname "${BASH_SOURCE[0]}" )/.." + +python "./scripts/insert-example.py" "README.template" > "README.md" + +rm "README.template" diff --git a/scripts/insert-example.py b/scripts/insert-example.py new file mode 100644 index 0000000..bd83ce9 --- /dev/null +++ b/scripts/insert-example.py @@ -0,0 +1,34 @@ +import argparse +import os +import re +import typing + +REPLACE_RE = re.compile(r'^%insert (?P[^%]+)%$', re.MULTILINE) + + +def read_text(filename: str) -> str: + with open(filename, "rt") as rf: + text = rf.read() + return text + + +def main(template: typing.TextIO) -> None: + content: str = template.read() + + def sub_match(match): + file_name = match.group('file_name') + return read_text(file_name) + + text = REPLACE_RE.sub(sub_match, content) + print(text) + + +def parse_args() -> typing.Dict[str, typing.Any]: + parser = argparse.ArgumentParser() + parser.add_argument("template", type=argparse.FileType("rt"), help="README.template") + kwargs = vars(parser.parse_args()) + return kwargs + + +if __name__ == "__main__": + main(**parse_args()) diff --git a/src/Aspose/BarCode/Configuration.php b/src/Aspose/BarCode/Configuration.php index e751a79..38a8138 100644 --- a/src/Aspose/BarCode/Configuration.php +++ b/src/Aspose/BarCode/Configuration.php @@ -20,7 +20,7 @@ class Configuration implements JsonSerializable * * @var string */ - protected $clientVersion = '24.6.0'; + protected $clientVersion = '24.7.0'; /** * ClientId for API