11Hermitage
22=========
33
4- How often do you have to store images, uploaded by users?
5- Rather , very often.
6- Give these images mobile applications are not so simple, because there are many devices with different parameters.
7- What to do? Help comes from Hermitage.
4+ How often do you have to store images that were uploaded by users?
5+ Probably , very often.
6+ Putting these images into mobile applications is not so simple, because there are many devices with different parameters.
7+ A solution comes with Hermitage.
88
9- Hermitage is a micro-service based on Slim that provides storage,
10- delivery and modification of your images for the desired clients and devices. Hermitage can:
11- * Take and give the image through the simple REST API
12- * Use as a repository local file system, or Amazon S3. If this is not enough, you can easily write your own adapter
13- * Give the image in one of a few preset formats. Add your own - a matter of seconds!
9+ Hermitage is a micro-service based on Slim. It provides storage,
10+ delivery and modification of your images for clients and devices you want . Hermitage can:
11+ * Take and put the image through the simple REST API
12+ * Use local file system or Amazon S3 as a repository. And you can easily write your own adapter if needed.
13+ * Put the image in one of preset formats. You can add your own - it's a matter of seconds!
1414
15- And all this is out of the box. Amazing! In addition, hermitage is very easy and simple to use.
16- This document will be enough to understand . So, let's begin!
15+ And all of it is out of the box. Amazing! In addition, Hermitage is very simple and easy to use.
16+ The information bellow will cover the details . So, let's begin!
1717
1818
1919# Installation
2020
21- Initially , you need to install composer lib and after that to add a config file,
22- set environment and create index file for your web-server.
23- You need to do it manually , or you may use pre-setted skeleton
21+ At first , you will need to install a composer lib and after that - to add a config file,
22+ then create an index file for your web-server and set environment variables .
23+ You can do it either by hand , or by using pre-setted skeleton
2424([ Hermitage Skeleton] ( https://github.com/LiveTyping/hermitage-skeleton ) ) and skip this section.
2525
2626Run the [ Composer] ( https://getcomposer.org ) command to install:
@@ -31,7 +31,7 @@ composer require livetyping/hermitage ~0.1
3131
3232### Config file
3333
34- You may put your config in ` config/main.php ` or so.
34+ You can put your config in ` config/main.php ` or so.
3535
3636``` php
3737return [
@@ -80,7 +80,7 @@ return [
8080
8181### Environment variables
8282
83- Copy the ` .env.example ` file to the local ` .env ` and configure it:
83+ Copy the ` .env.example ` file to a local ` .env ` and configure it:
8484
8585``` bash
8686cp vendor/livetyping/hermitage/.env.example .env
@@ -108,7 +108,7 @@ STORAGE_ADAPTER=local
108108
109109### Index file
110110
111- You may put it in ` public/index.php ` or so.
111+ You can put it in ` public/index.php ` or so.
112112
113113``` php
114114require __DIR__ . '/../vendor/autoload.php';
@@ -125,24 +125,24 @@ livetyping\hermitage\bootstrap\app($sources)->run();
125125
126126# REST API
127127
128- Hermitage provides simple API to upload, download and delete your images.
128+ Hermitage provides a simple API so you could upload, download and delete your images.
129129
130130### Signing write requests
131131
132- To be able to write to Hermitage the user agent will have to specify two request headers:
132+ To write to Hermitage a user agent will have to be specified by two request headers:
133133` X-Authenticate-Signature ` and ` X-Authenticate-Timestamp ` .
134134
135135` X-Authenticate-Signature ` is, like the access token, an HMAC (also using SHA-256 and the secret key).
136136
137- The data for the hash is generated using the following elements:
137+ The data for the hash is generated with the following elements:
138138
139139* HTTP method (POST or DELETE)
140140* The URI
141141* UTC timestamp (integer only)
142142
143- These elements are concatenated in the above order with ` | ` as a delimiter character,
144- and a hash is generated using the secret key.
145- The following snippet shows how this can be accomplished in PHP when deleting an image:
143+ These elements are concatenated in the previous order with ` | ` as a delimiter character,
144+ and the hash is generated with the secret key.
145+ The following snippet shows how it can be accomplished with PHP when deleting the image:
146146
147147``` php
148148$timestamp = (new DateTime('now', new DateTimeZone('UTC')))->getTimestamp();
@@ -189,7 +189,7 @@ results in:
189189
190190### Delete
191191
192- Deleting images from Hermitage is accomplished by requesting the image URIs using ` HTTP DELETE ` .
192+ Deleting images from Hermitage can be done by requesting image's URIs with ` HTTP DELETE ` .
193193
194194``` bash
195195curl -XDELETE http://hermitage/< filename> -H " X-Authenticate-Timestamp: <timestamp>" -H " X-Authenticate-Signature: <signature>"
0 commit comments