Added dev php config and removed .env dependencies

This commit is contained in:
Alejandro Celaya 2019-12-17 21:20:24 +01:00
parent 9f2ede0b84
commit 0152f6fa1a
13 changed files with 32 additions and 47 deletions

View file

@ -1,10 +0,0 @@
# Application
APP_ENV=
SECRET_KEY=
SHORTENED_URL_SCHEMA=
SHORTENED_URL_HOSTNAME=
# Database
DB_USER=
DB_PASSWORD=
DB_NAME=

1
.gitattributes vendored
View file

@ -9,7 +9,6 @@
/module/PreviewGenerator/test-db export-ignore
/module/Rest/test export-ignore
/module/Rest/test-api export-ignore
.env.dist export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.phpstorm.meta.php export-ignore

1
.gitignore vendored
View file

@ -4,7 +4,6 @@ build
composer.lock
composer.phar
vendor/
.env
data/database.sqlite
data/shlink-tests.db
data/GeoLite2-City.mmdb

View file

@ -65,7 +65,6 @@
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.0.0",
"shlinkio/shlink-test-utils": "^1.2",
"symfony/dotenv": "^5.0",
"symfony/var-dumper": "^5.0"
},
"autoload": {

View file

@ -11,9 +11,9 @@ return [
'proxies_dir' => 'data/proxies',
],
'connection' => [
'user' => env('DB_USER'),
'password' => env('DB_PASSWORD'),
'dbname' => env('DB_NAME', 'shlink'),
'user' => '',
'password' => '',
'dbname' => 'shlink',
'charset' => 'utf8',
],
],

View file

@ -1,8 +1,13 @@
<?php
declare(strict_types=1);
return [
'entity_manager' => [
'connection' => [
'user' => 'root',
'password' => 'root',
'driver' => 'pdo_mysql',
'host' => 'shlink_db',
'driverOptions' => [

View file

@ -2,14 +2,12 @@
declare(strict_types=1);
use function Shlinkio\Shlink\Common\env;
return [
'url_shortener' => [
'domain' => [
'schema' => env('SHORTENED_URL_SCHEMA', 'http'),
'hostname' => env('SHORTENED_URL_HOSTNAME'),
'schema' => 'https',
'hostname' => '',
],
'validate_url' => true,
],

View file

@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
return [
'url_shortener' => [
'domain' => [
'schema' => 'http',
'hostname' => '',
],
],
];

View file

@ -2,21 +2,12 @@
declare(strict_types=1);
use Symfony\Component\Dotenv\Dotenv;
use Zend\ServiceManager\ServiceManager;
chdir(dirname(__DIR__));
require 'vendor/autoload.php';
// If the Dotenv class exists, load env vars and enable errors
if (class_exists(Dotenv::class)) {
error_reporting(E_ALL);
ini_set('display_errors', '1');
$dotenv = new Dotenv(true);
$dotenv->load(__DIR__ . '/../.env');
}
// Build container
$config = require __DIR__ . '/config.php';
$container = new ServiceManager($config['dependencies']);

View file

@ -7,14 +7,6 @@ namespace Shlinkio\Shlink\TestUtils;
use Doctrine\ORM\EntityManager;
use Psr\Container\ContainerInterface;
use function file_exists;
use function touch;
// Create an empty .env file
if (! file_exists('.env')) {
touch('.env');
}
/** @var ContainerInterface $container */
$container = require __DIR__ . '/../container.php';
$testHelper = $container->get(Helper\TestHelper::class);

View file

@ -6,14 +6,6 @@ namespace Shlinkio\Shlink\TestUtils;
use Psr\Container\ContainerInterface;
use function file_exists;
use function touch;
// Create an empty .env file
if (! file_exists('.env')) {
touch('.env');
}
/** @var ContainerInterface $container */
$container = require __DIR__ . '/../container.php';
$container->get(Helper\TestHelper::class)->createTestDb();

View file

@ -1 +1,6 @@
date.timezone = Europe/Madrid
display_errors=On
error_reporting=-1
memory_limit=-1
log_errors_max_len=0
zend.assertions=1
assert.exception=1

View file

@ -3,7 +3,7 @@ version: '3'
services:
shlink_nginx:
container_name: shlink_nginx
image: nginx:1.15.9-alpine
image: nginx:1.17.6-alpine
ports:
- "8000:80"
volumes:
@ -37,6 +37,7 @@ services:
- "9001:9001"
volumes:
- ./:/home/shlink
- ./data/infra/php.ini:/usr/local/etc/php/php.ini
links:
- shlink_db
- shlink_db_postgres