Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit ee2bcea

Browse files
committed
Update version 1.0.0.8
1 parent 53d2aa8 commit ee2bcea

File tree

6 files changed

+285
-121
lines changed

6 files changed

+285
-121
lines changed

README.md

Lines changed: 152 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<img src="https://img.shields.io/badge/stability-stable-green.svg" alt="Status">
88
</a>
99
<a href="#changelog">
10-
<img src="https://img.shields.io/badge/release-v1.0.0.7-blue.svg" alt="Version">
10+
<img src="https://img.shields.io/badge/release-v1.0.0.8-blue.svg" alt="Version">
1111
</a>
1212
<a href="#changelog">
13-
<img src="https://img.shields.io/badge/update-january-yellowgreen.svg" alt="Update">
13+
<img src="https://img.shields.io/badge/update-october-yellowgreen.svg" alt="Update">
1414
</a>
1515
<a href="#license">
1616
<img src="https://img.shields.io/badge/license-MIT%20License-green.svg" alt="License">
@@ -37,6 +37,7 @@ This page will help you get started with this API.
3737
* PHP 5.6
3838
* MySQL or MariaDB
3939
* Apache Server
40+
* Slim Framework v3
4041

4142
<a name="installation"></a>
4243
### Installation
@@ -220,6 +221,13 @@ SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
220221

221222
Change the database configuration in the new file.
222223

224+
<a name="Donate"></a>
225+
## :gift: Donate!
226+
227+
If you want to help me to continue this project, you might donate via PayPal.
228+
229+
<a href="https://paypal.me/ManuelFGil"><img src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png" alt="Donate via PayPal"></a>
230+
223231
<a name="deployment"></a>
224232
## :package: Deployment
225233

@@ -235,74 +243,133 @@ SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
235243

236244
* `get` => `/ping` - This method is used for testing the api. e.g.:
237245

238-
> uri = `/public/webresources/mobile_app/ping`
246+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/ping`
239247
240248

241249
* `get` => `/login/{user}/{password}` - This method gets a user into the database. e.g.:
242250

243-
> uri = `/public/webresources/mobile_app/login/testUser/testPwd`
251+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/login/testUser/testPwd`
244252
253+
```php
254+
parameters = [
255+
/** @var string $user - username */
256+
string $user => "testUser",
257+
/** @var string $password - password */
258+
string $password => "testPwd"
259+
]
260+
```
245261

246-
* `post` => `/register` - This method sets a user into the database. e.g.:
247262

248-
> uri = `/public/webresources/mobile_app/register`
263+
* `post` => `/register` - This method sets a user into the database. e.g.:
249264

250-
> args = [user =>testUser, password => testPwd, email => example@example.com, country => 1]
265+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/register`
266+
267+
```php
268+
parameters = [
269+
/** @var string $user - username */
270+
string $user => "testUser",
271+
/** @var string $password - password */
272+
string $password => "testPwd",
273+
/** @var string $email - password */
274+
string $email => "example@example.com",
275+
/** @var int $country - country id */
276+
int $country => 1
277+
]
278+
```
251279

252280

253281
* `get` => `/validate/{user}/{token}` - This method verify the user account. e.g.:
254282

255-
> uri = `/public/webresources/mobile_app/validate/testUser/326f0911657d94d0a48530058ca2a383`
283+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/validate/testUser/326f0911657d94d0a48530058ca2a383`
284+
285+
```php
286+
parameters = [
287+
/** @var string $user - username */
288+
string $user => "testUser",
289+
/** @var string $token - token validation */
290+
string $token => "326f0911657d94d0a48530058ca2a383"
291+
]
292+
```
256293

257294

258295
* `put` => `/update` - This method sets a user into the database. e.g.:
259296

260-
> uri = `/public/webresources/mobile_app/update`
297+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/update`
261298
262-
> args = [country => 1]
299+
```php
300+
parameters = [
301+
/** @var int $country - country id */
302+
int $country => 1
303+
]
304+
```
263305

264306

265307
* `get` => `/verify` - This method checks the token. e.g.:
266308

267-
> uri = `/public/webresources/mobile_app/verify`
309+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/verify`
310+
311+
```php
312+
headers = [
313+
/** @var string $authorization - JWT Authentication */
314+
string $authorization => "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOjEsInVzZXIiOiJ0ZXN0VXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTktMDEtMDEgMDA6MDA6MDAiLCJleHAiOiIyMDIwLTAxLTAxIDAwOjAwOjAwIn19.RTTPlUqE--WMP9M28-oj7p8MhWdisuuhWBsioDa_bgY"
315+
]
316+
```
268317

269318

270319
* `post` => `/post` - This method publish short text messages of no more than 120 characters. e.g.:
271320

272-
> uri = `/public/webresources/mobile_app/post`
321+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/post`
273322
274-
> args = [quote =>quote, id => userId]
323+
```php
324+
parameters = [
325+
/** @var string $quote - quote */
326+
string $quote => "test",
327+
/** @var int $id - user id */
328+
int $id => 1
329+
]
330+
```
275331

276332

277333
* `get` => `/list` - This method list the latest published messages. e.g.:
278334

279-
> uri = `/public/webresources/mobile_app/list`
335+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/list`
280336
281337

282338
* `get` => `/likes/{id}` - get method - This method list the users for likes. e.g.:
283339

284-
> uri = `/public/webresources/mobile_app/likes/1`
340+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/likes/1`
285341
342+
```php
343+
parameters = [
344+
/** @var int $id - quote id */
345+
int $id => 1
346+
]
347+
```
286348

287-
* `get` => `/search/{quote}` - get method - This method searches for messages by your text. e.g.:
288349

289-
> uri = `/public/webresources/mobile_app/search/Quote`
350+
* `get` => `/search/{quote}` - get method - This method searches for messages by your text. e.g.:
290351

352+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/search/quote`
291353
292-
* `delete` => `/delete` - delete method - This method deletes a specific message by its id. e.g.:
354+
```php
355+
parameters = [
356+
/** @var string $quote - text search */
357+
string $quote => "quote"
358+
]
359+
```
293360

294-
> uri = `/public/webresources/mobile_app/delete`
295361

296-
> args = [id => quoteId]
362+
* `delete` => `/delete` - delete method - This method deletes a specific message by its id. e.g.:
297363

364+
> uri = `http://localhost/REST-Api-with-Slim-PHP/public/webresources/mobile_app/delete`
298365
299-
<a name="built"></a>
300-
## :wrench: Built With
366+
```php
367+
parameters = [
368+
/** @var int $id - quote id */
369+
int $id => 1
370+
]
371+
```
301372

302-
* XAMPP for Windows 5.6.32 ([XAMPP](https://www.apachefriends.org/download.html))
303-
* Visual Studio Code ([VSCode](https://code.visualstudio.com/))
304-
* COMPOSER ([COMPOSER](https://getcomposer.org/))
305-
* RestEasy Extension for Chrome ([RestEasy](https://chrome.google.com/webstore/detail/resteasy/nojelkgnnpdmhpankkiikipkmhgafoch))
306373

307374
<a name="test"></a>
308375
## :100: Running the tests
@@ -317,19 +384,77 @@ Put the token on an HTTP header called Authorization. e.g.:
317384

318385
* Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWFkZXIiOnsiaWQiOjEsInVzZXIiOiJ0ZXN0VXNlciJ9LCJwYXlsb2FkIjp7ImlhdCI6IjIwMTktMDEtMDEgMDA6MDA6MDAiLCJleHAiOiIyMDIwLTAxLTAxIDAwOjAwOjAwIn19.RTTPlUqE--WMP9M28-oj7p8MhWdisuuhWBsioDa_bgY
319386

387+
320388
<div align="center">
321389
<img src="https://raw.githubusercontent.com/ManuelGil/REST-Api-with-Slim-PHP/master/docs/images/headers.gif" alt="headers">
322390
</div>
323391

392+
324393
Checks if the `iat` (issued at) and `exp` (expiration time) are correct in [https://jwt.io/](https://jwt.io/).
325394

395+
326396
<div align="center">
327397
<img src="https://raw.githubusercontent.com/ManuelGil/REST-Api-with-Slim-PHP/master/docs/images/jwt.png" alt="jwt">
328398
</div>
329399

400+
401+
<a name="built"></a>
402+
## :wrench: Built With
403+
404+
* XAMPP for Windows 5.6.32 ([XAMPP](https://www.apachefriends.org/download.html))
405+
* Visual Studio Code ([VSCode](https://code.visualstudio.com/))
406+
* COMPOSER ([COMPOSER](https://getcomposer.org/))
407+
* RestEasy Extension for Chrome ([RestEasy](https://chrome.google.com/webstore/detail/resteasy/nojelkgnnpdmhpankkiikipkmhgafoch))
408+
330409
<a name="changelog"></a>
331410
## :information_source: Changelog
332411

412+
**1.0.0.8** (10/16/2019)
413+
414+
* <table border="0" cellpadding="4">
415+
<tr>
416+
<td>
417+
<strong>Language:</strong>
418+
</td>
419+
<td>
420+
PHP
421+
</td>
422+
</tr>
423+
<tr>
424+
<td><strong>
425+
Requirements:
426+
</strong></td>
427+
<td>
428+
<ul>
429+
<li>
430+
PHP 5.6
431+
</li>
432+
<li>
433+
MySQL or MariaDB
434+
</li>
435+
<li>
436+
Apache Server
437+
</li>
438+
</ul>
439+
</td>
440+
</tr>
441+
<tr>
442+
<td>
443+
<strong>Changes:</strong>
444+
</td>
445+
<td>
446+
<ul>
447+
<li>
448+
Fix responses
449+
</li>
450+
<li>
451+
Implements caches
452+
</li>
453+
</ul>
454+
</td>
455+
</tr>
456+
</table>
457+
333458
**1.0.0.7** (01/24/2019)
334459

335460
* <table border="0" cellpadding="4">
@@ -652,17 +777,10 @@ Checks if the `iat` (issued at) and `exp` (expiration time) are correct in [http
652777
</tr>
653778
</table>
654779

655-
<a name="Donate"></a>
656-
## :gift: Donate!
657-
658-
If you want to help me to continue this project, you might donate via PayPal.
659-
660-
<a href="https://paypal.me/ManuelFGil"><img src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png" alt="Donate via PayPal"></a>
661-
662780
<a name="authors"></a>
663781
## :eyeglasses: Authors
664782

665-
* **Manuel Gil** - *Initial work* - [ManuelGil](https://github.com/ManuelGil)
783+
* **Manuel Gil** - *Owner* - [ManuelGil](https://github.com/ManuelGil)
666784

667785
See also the list of [contributors](https://github.com/ManuelGil/REST-Api-with-Slim-PHP/contributors)
668786
who participated in this project.

composer.json

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
{
22
"name": "manuelgil/rest-api-with-slim-php",
33
"description": "REST API with PHP Slim Framework 3 and MySQL",
4+
"version": "1.0.0.8",
45
"type": "project",
56
"license": "MIT",
67
"authors": [
78
{
89
"name": "Manuel Gil",
9-
"email": "atencion.ms@outlook.com"
10+
"email": "atencion.ms@outlook.com",
11+
"role": "Developer"
1012
}
1113
],
1214
"require": {
1315
"php": ">=5.6.4",
14-
"slim/slim": "^3.9",
15-
"monolog/monolog": "^1.23",
16-
"vlucas/phpdotenv": "^2.5",
17-
"tuupola/slim-jwt-auth": "^2.3",
18-
"phpmailer/phpmailer": "^6.0"
16+
"monolog/monolog": "^1.25",
17+
"phpmailer/phpmailer": "^6.1",
18+
"slim/http-cache": "^0.4.0",
19+
"slim/slim": "^3.12",
20+
"tuupola/slim-jwt-auth": "^2.4",
21+
"vlucas/phpdotenv": "^2.6"
22+
},
23+
"support": {
24+
"issues": "https://github.com/ManuelGil/REST-Api-with-Slim-PHP/issues",
25+
"source": "https://github.com/ManuelGil/REST-Api-with-Slim-PHP"
26+
},
27+
"autoload": {
28+
"files": [
29+
"src/config/config.php"
30+
],
31+
"classmap": [
32+
"src/libs"
33+
]
34+
},
35+
"minimum-stability": "stable",
36+
"config": {
37+
"preferred-install": "dist",
38+
"optimize-autoloader": true,
39+
"sort-packages": true
1940
}
2041
}

0 commit comments

Comments
 (0)