Skip to content

Commit 6aab6ad

Browse files
committed
Initial commit.
0 parents  commit 6aab6ad

6 files changed

Lines changed: 555 additions & 0 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/README.md export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor/
2+
composer.lock

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# WEBDEVPACK SDK for PHP
2+
3+
WEBDEVPACK SDK for PHP provides a simple, expressive way to integrate WEBDEVPACK's tools into your PHP applications. Easily access web-development utilities, automate workflows, and build faster with a unified PHP interface.
4+
5+
## Install via Composer
6+
7+
```shell
8+
composer require webdevpack/sdk-php
9+
```
10+
11+
## Examples
12+
13+
```php
14+
$wdp = new WebDevPack\Client(['apiKey' => 'YOUR-API-KEY']);
15+
16+
// Optimize images
17+
$wdp->optimizeImage($sourceFilename, $targetFilename,80);
18+
19+
// Minify JavaScript
20+
$wdp->minifyJavaScriptFile($sourceFilename, $targetFilename);
21+
22+
// Get text from image (OCR)
23+
$result = $wdp->getTextFromImage($sourceFilename, 'eng');
24+
```
25+
26+
## Documentation
27+
28+
Full [documentation](https://github.com/webdevpack/sdk-php/blob/master/docs/markdown/index.md) is available as part of this repository.
29+
30+
## License
31+
This project is licensed under the MIT License. See the [license file](https://github.com/webdevpack/sdk-php/blob/master/LICENSE) for more information.

autoload.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* WebDevPack SDK for PHP
5+
* https://github.com/webdevpack/sdk-php
6+
* Copyright (c) Amplilabs Ltd.
7+
* Free to use under the MIT license.
8+
*/
9+
10+
$classes = array(
11+
'WebDevPack\Client' => 'src/Client.php'
12+
);
13+
14+
spl_autoload_register(function ($class) use ($classes): void {
15+
if (isset($classes[$class])) {
16+
require __DIR__ . '/' . $classes[$class];
17+
}
18+
}, true);

composer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "webdevpack/sdk-php",
3+
"description": "WebDevPack SDK for PHP",
4+
"license": "MIT",
5+
"homepage": "https://webdevpack.com/",
6+
"support": {
7+
"email": "support@webdevpack.com"
8+
},
9+
"require": {
10+
"php": "8.4.*|8.5.*"
11+
},
12+
"require-dev": {
13+
"ivopetkov/docs-generator": "1.*"
14+
},
15+
"autoload": {
16+
"files": [
17+
"autoload.php"
18+
]
19+
}
20+
}

0 commit comments

Comments
 (0)