https://github.com/webpractik/ocf-converter-sdk-php
SDK for onlineconvertfree.com file conversion API
https://github.com/webpractik/ocf-converter-sdk-php
api sdk
Last synced: about 2 months ago
JSON representation
SDK for onlineconvertfree.com file conversion API
- Host: GitHub
- URL: https://github.com/webpractik/ocf-converter-sdk-php
- Owner: webpractik
- License: mit
- Created: 2022-10-27T08:34:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T08:52:59.000Z (over 3 years ago)
- Last Synced: 2025-11-12T19:24:28.655Z (6 months ago)
- Topics: api, sdk
- Language: PHP
- Homepage: https://onlineconvertfree.com/file-conversion-api/
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ocf-converter-sdk
SDK for [onlineconvertfree.com](https://onlineconvertfree.com/) [file conversion API](https://onlineconvertfree.com/file-conversion-api/).
## Installation & Usage
### Requirements
PHP 7.4 and later.
Should also work with PHP 8.0.
### Composer
The recommended way to install SDK is through [Composer](https://getcomposer.org/).
```shell
composer require webpractik/ocf-converter-sdk
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then start from the following:
```php
uploadFile($filePath, $extensionToConvertTo);
$result = $task->waitForConversion();
if ($result->isSuccess()) {
$resultUrl = $result->getResultingFileUrl();
$resultFileName = basename($resultUrl);
if (file_put_contents($resultFileName, file_get_contents($resultUrl))) {
$result->deleteFile();
}
}
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), PHP_EOL;
}
```
## License
SDK is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## Contribution
[OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator-cli/) is used for the client generation.
### Requirements
JRE and [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator-cli/) are required for the client generation.
### Client generation
To regenerate the client do the following:
- run generation command:
```shell
composer api-codegen
```
- reformat the generated code with your IDE.