Skip to content

Commit beaef09

Browse files
committed
readme update
1 parent 48a48f7 commit beaef09

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
PHP SDK for [ImageKit](https://imagekit.io/) implements the new APIs and interface for different file operations.
77

8-
ImageKit is complete media storage, optimization, and transformation solution that comes with an [image and video CDN](https://imagekit.io/features/imagekit-infrastructure). It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
8+
ImageKit is complete media storage, optimization, and transformation solution that comes with an [image and video CDN](https://imagekit.io/). It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes.
99

1010
- [Key Features](#key-features)
1111
- [Requirements](#requirements)
@@ -80,6 +80,7 @@ You can use this PHP SDK for three different methods - URL generation, file uplo
8080
5. **Using the SDK** – The best way to become familiar with how to use the SDK is to follow the examples provided in the [quick start guide](https://docs.imagekit.io/getting-started/quickstart-guides/php).
8181

8282
## Quick Examples
83+
8384
#### Create an ImageKit Instance
8485
```php
8586
// Require the Composer autoloader.
@@ -108,13 +109,14 @@ echo $imageURL;
108109
```php
109110
// For File Upload
110111
$uploadFile = $imageKit->uploadFile([
111-
'file' => 'file-url',
112-
'fileName' => 'new-file'
112+
'file' => 'file-url', # required, "binary","base64" or "file url"
113+
'fileName' => 'new-file' # required
113114
]);
114115
```
115116

116117
#### Response Structure
117118
Following is the response for [server-side file upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload#response-code-and-structure-json)
119+
118120
```json
119121
{
120122
"error": null,
@@ -184,9 +186,10 @@ Following is the response for [server-side file upload API](https://docs.imageki
184186

185187
### Using relative file path and URL endpoint
186188

187-
This method allows you to create an URL to access a file using the relative file path and the ImageKit URL endpoint (`urlEndpoint`). The file can be an image, video or any other static file supported by ImageKit.
189+
This method allows you to create an URL to access a file using the relative file path and the ImageKit URL endpoint (`urlEndpoint`). The file can be an image, video, or any other static file supported by ImageKit.
188190

189191
#### Example
192+
190193
```php
191194
$imageURL = $imageKit->url(
192195
[
@@ -236,7 +239,7 @@ The `$imageKit->url()` method accepts the following parameters.
236239
| path | Conditional. This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
237240
| src | Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. |
238241
| transformation | Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as different objects of the array. The complete [List of supported transformations](#list-of-supported-transformations) in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. |
239-
| transformationPosition | Optional. The default value is `path` that places the transformation string as a path parameter in the URL. It can also be specified as `query`, which adds the transformation string as the query parameter `tr` in the URL. If you use the `src` parameter to create the URL, the transformation string is always added as a query parameter. |
242+
| transformationPosition | Optional. The default value is `path` which places the transformation string as a path parameter in the URL. It can also be specified as `query`, which adds the transformation string as the query parameter `tr` in the URL. The transformation string is always added as a query parameter if you use the `src` parameter to create the URL. |
240243
| queryParameters | Optional. These are the other query parameters that you want to add to the final URL. These can be any query parameters and are not necessarily related to ImageKit. Especially useful if you want to add some versioning parameters to your URLs. |
241244
| signed | Optional. Boolean. The default value is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. |
242245
| expireSeconds | Optional. Integer. It is used along with the `signed` parameter. It specifies the time in seconds from now when the signed URL will expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly.
@@ -320,7 +323,7 @@ https://ik.imagekit.io/your_imagekit_id/endpoint/tr:f-jpg,pr-true,e-sharpen,e-co
320323

321324
### 3. Resizing images and videos
322325
Let's resize the image to `width` 400 and `height` 300.
323-
Check detailed instructions on [resize, crop and other Common transformations](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations)
326+
Check detailed instructions on [resize, crop, and other Common transformations](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations)
324327

325328
#### Example
326329
```php
@@ -557,9 +560,9 @@ $uploadFile = $imageKit->uploadFile([
557560
}
558561
```
559562
#### Optional Parameters
560-
Please refer to [server-side file upload API request structure](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload#request-structure-multipart-form-data) for detailed explanation about mandatory and optional parameters.
561-
```php
563+
Please refer to [server-side file upload API request structure](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload#request-structure-multipart-form-data) for a detailed explanation of mandatory and optional parameters.
562564

565+
```php
563566
// Attempt File Uplaod
564567
$uploadFile = $imageKit->uploadFile([
565568
'file' => 'your_file', // required, "binary","base64" or "file url"
@@ -607,6 +610,7 @@ $listFiles = $imageKit->listFiles();
607610
```
608611
#### Applying Filters
609612
Filter out the files with an object specifying the parameters.
613+
610614
```php
611615
$listFiles = $imageKit->listFiles([
612616
"type" => "file", // file, file-version or folder
@@ -621,6 +625,7 @@ $listFiles = $imageKit->listFiles([
621625

622626
#### Advance Search
623627
In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and providing this generated string as the value of the `searchQuery`.
628+
624629
```php
625630
$listFiles = $imageKit->listFiles([
626631
"searchQuery" => '(size < "1mb" AND width > 500) OR (tags IN ["summer-sale","banner"])',
@@ -641,7 +646,7 @@ $getFileDetails = $imageKit->getFileDetails('file_id');
641646

642647
### 3. Get File Version Details
643648

644-
This API can get you all the details and attributes for the provided version of the file.`versionID` is returned in list file API response.
649+
This API can get you all the details and attributes for the provided version of the file.
645650

646651
Refer to the [get file version details API](https://docs.imagekit.io/api-reference/media-api/get-file-version-details) for a better understanding of the **request & response structure**.
647652

@@ -745,7 +750,7 @@ $bulkRemoveTags = $imageKit->bulkRemoveTags($fileIds, $AITags);
745750

746751
You can programmatically delete uploaded files in the media library using delete file API.
747752

748-
> If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using [Purge Cache API](#21-purge-cache-api).
753+
> If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. However, you can purge the cache using [Purge Cache API](#21-purge-cache-api).
749754
750755
Refer to the [delete file API](https://docs.imagekit.io/api-reference/media-api/delete-file) for better understanding about the **request & response structure**.
751756

@@ -946,7 +951,7 @@ $bulkJobStatus = $imageKit->getBulkJobStatus($jobId);
946951

947952
### 21. Purge Cache API
948953

949-
This will purge CDN and ImageKit.io's internal cache. In response `requestId` is returned which can be used to fetch the status of the submitted purge request with [Purge Cache Status API](#22-purge-cache-status-api).
954+
This will purge CDN and ImageKit.io's internal cache. In response, `requestId` is returned, which can be used to fetch the status of the submitted purge request with [Purge Cache Status API](#22-purge-cache-status-api).
950955

951956
Refer to the [Purge Cache API](https://docs.imagekit.io/api-reference/media-api/purge-cache) for a better understanding of the **request & response structure**.
952957

@@ -1037,7 +1042,7 @@ $getCustomMetadataField = $imageKit->getCustomMetadataField($includeDeleted);
10371042

10381043
### 3. Update Fields
10391044

1040-
Update the `label` or `schema` of an existing custom metadata field.
1045+
Update an existing custom metadata field's `label` or `schema`.
10411046

10421047
Refer to the [update custom metadata fields API](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/update-custom-metadata-field) for a better understanding of the **request & response structure**.
10431048

@@ -1077,7 +1082,7 @@ We have included the following commonly used utility functions in this SDK.
10771082

10781083
### Authentication parameter generation
10791084

1080-
If you are looking to implement client-side file upload, you will need a `token`, `expiry` timestamp, and a valid `signature` for that upload. The SDK provides a simple method that you can use in your code to generate these authentication parameters for you.
1085+
If you want to implement client-side file upload, you will need a `token`, `expiry` timestamp, and a valid `signature` for that upload. The SDK provides a simple method you can use in your code to generate these authentication parameters.
10811086

10821087
_Note: The Private API Key should never be exposed in any client-side code. You must always generate these authentication parameters on the server-side_
10831088

@@ -1095,7 +1100,7 @@ Returns
10951100
}
10961101
```
10971102

1098-
Both the `token` and `expire` parameters are optional. If not specified, the SDK generates a random token and also generates a valid expiry timestamp internally. The value of the `token` and `expire` used to create the signature is always returned in the response, whether they are provided in input or not.
1103+
Both the `token` and `expire` parameters are optional. If not specified, the SDK internally generates a random token and a valid expiry timestamp. The value of the `token` and `expire` used to create the signature is always returned in the response, whether they are provided in input or not.
10991104

11001105
### Distance calculation between two pHash values
11011106

@@ -1121,7 +1126,7 @@ $imageKit->pHashDistance('a4a65595ac94518b', '7838873e791f8400');
11211126
```
11221127

11231128
## Opening Issues
1124-
If you encounter a bug with `imagekit-php` we would like to hear about it. Search the existing issues and try to make sure your problem doesnt already exist before opening a new issue. Its helpful if you include the version of `imagekit-php`, PHP version, and OS youre using. Please include a stack trace and a simple workflow to reproduce the case when appropriate, too.
1129+
If you encounter a bug with `imagekit-php` we would like to hear about it. Search the existing issues and try to make sure your problem doesn't already exist before opening a new issue. It's helpful if you include the version of `imagekit-php`, PHP version, and OS you're using. Please include a stack trace and a simple workflow to reproduce the case when appropriate, too.
11251130

11261131

11271132
## Support

0 commit comments

Comments
 (0)