Skip to content

Commit

Permalink
Merge pull request #47 from maurobonfietti/0.30.0
Browse files Browse the repository at this point in the history
Version 0.30.0
  • Loading branch information
maurobonfietti committed Dec 26, 2020
2 parents f625b88 + daf0b18 commit f656f00
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ DB_HOST='127.0.0.1'
DB_NAME='slim4_api_skeleton'
DB_USER='root'
DB_PASS=''
DB_PORT='3306'

DISPLAY_ERROR_DETAILS=true
SLIM_BASE_PATH=''
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- '7.3'
- '7.4'
- '7.3.24'
- '7.4.0'

services:
- mysql
Expand All @@ -13,6 +13,8 @@ env:
- DB_NAME=slim4_api_skeleton
- DB_USER=root
- DB_PASS=
- DB_PORT=3306
- XDEBUG_MODE=coverage

before_install:
- mysql -e 'CREATE DATABASE slim4_api_skeleton'
Expand All @@ -23,5 +25,5 @@ before_script:
- cp .env.example .env

script:
- vendor/bin/phpunit --coverage-clover clover.xml
- XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover clover.xml
- vendor/bin/php-coveralls --coverage_clover=clover.xml -v
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ DB_HOST='127.0.0.1'
DB_NAME='yourMySqlDatabase'
DB_USER='yourMySqlUsername'
DB_PASS='yourMySqlPassword'
DB_PORT='3306'
```


Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- DB_NAME=slim4_api_skeleton
- DB_USER=root
- DB_PASS=
- DB_PORT=3306

volumes:
- ./:/var/www/html
Expand Down
5 changes: 3 additions & 2 deletions src/App/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
/** @var Container $container */
$container['db'] = static function (): PDO {
$dsn = sprintf(
'mysql:host=%s;dbname=%s;charset=utf8',
'mysql:host=%s;dbname=%s;port=%s;charset=utf8',
$_SERVER['DB_HOST'],
$_SERVER['DB_NAME']
$_SERVER['DB_NAME'],
$_SERVER['DB_PORT']
);
$pdo = new PDO($dsn, $_SERVER['DB_USER'], $_SERVER['DB_PASS']);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Expand Down
2 changes: 1 addition & 1 deletion src/App/DotEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
if (file_exists($baseDir . '.env')) {
$dotenv->load();
}
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS']);
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS', 'DB_PORT']);
2 changes: 1 addition & 1 deletion src/Controller/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class Home
{
private const API_NAME = 'slim4-api-skeleton';

private const API_VERSION = '0.29.0';
private const API_VERSION = '0.30.0';

/** @var Container */
private $container;
Expand Down

0 comments on commit f656f00

Please sign in to comment.