mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added dev php config and removed .env dependencies
This commit is contained in:
parent
9f2ede0b84
commit
0152f6fa1a
10
.env.dist
10
.env.dist
@ -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
1
.gitattributes
vendored
@ -9,7 +9,6 @@
|
|||||||
/module/PreviewGenerator/test-db export-ignore
|
/module/PreviewGenerator/test-db export-ignore
|
||||||
/module/Rest/test export-ignore
|
/module/Rest/test export-ignore
|
||||||
/module/Rest/test-api export-ignore
|
/module/Rest/test-api export-ignore
|
||||||
.env.dist export-ignore
|
|
||||||
.gitattributes export-ignore
|
.gitattributes export-ignore
|
||||||
.gitignore export-ignore
|
.gitignore export-ignore
|
||||||
.phpstorm.meta.php export-ignore
|
.phpstorm.meta.php export-ignore
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,7 +4,6 @@ build
|
|||||||
composer.lock
|
composer.lock
|
||||||
composer.phar
|
composer.phar
|
||||||
vendor/
|
vendor/
|
||||||
.env
|
|
||||||
data/database.sqlite
|
data/database.sqlite
|
||||||
data/shlink-tests.db
|
data/shlink-tests.db
|
||||||
data/GeoLite2-City.mmdb
|
data/GeoLite2-City.mmdb
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
"roave/security-advisories": "dev-master",
|
"roave/security-advisories": "dev-master",
|
||||||
"shlinkio/php-coding-standard": "~2.0.0",
|
"shlinkio/php-coding-standard": "~2.0.0",
|
||||||
"shlinkio/shlink-test-utils": "^1.2",
|
"shlinkio/shlink-test-utils": "^1.2",
|
||||||
"symfony/dotenv": "^5.0",
|
|
||||||
"symfony/var-dumper": "^5.0"
|
"symfony/var-dumper": "^5.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -11,9 +11,9 @@ return [
|
|||||||
'proxies_dir' => 'data/proxies',
|
'proxies_dir' => 'data/proxies',
|
||||||
],
|
],
|
||||||
'connection' => [
|
'connection' => [
|
||||||
'user' => env('DB_USER'),
|
'user' => '',
|
||||||
'password' => env('DB_PASSWORD'),
|
'password' => '',
|
||||||
'dbname' => env('DB_NAME', 'shlink'),
|
'dbname' => 'shlink',
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'entity_manager' => [
|
'entity_manager' => [
|
||||||
'connection' => [
|
'connection' => [
|
||||||
|
'user' => 'root',
|
||||||
|
'password' => 'root',
|
||||||
'driver' => 'pdo_mysql',
|
'driver' => 'pdo_mysql',
|
||||||
'host' => 'shlink_db',
|
'host' => 'shlink_db',
|
||||||
'driverOptions' => [
|
'driverOptions' => [
|
||||||
|
@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use function Shlinkio\Shlink\Common\env;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'url_shortener' => [
|
'url_shortener' => [
|
||||||
'domain' => [
|
'domain' => [
|
||||||
'schema' => env('SHORTENED_URL_SCHEMA', 'http'),
|
'schema' => 'https',
|
||||||
'hostname' => env('SHORTENED_URL_HOSTNAME'),
|
'hostname' => '',
|
||||||
],
|
],
|
||||||
'validate_url' => true,
|
'validate_url' => true,
|
||||||
],
|
],
|
||||||
|
14
config/autoload/url-shortener.local.php.dist
Normal file
14
config/autoload/url-shortener.local.php.dist
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
'url_shortener' => [
|
||||||
|
'domain' => [
|
||||||
|
'schema' => 'http',
|
||||||
|
'hostname' => '',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
@ -2,21 +2,12 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Symfony\Component\Dotenv\Dotenv;
|
|
||||||
use Zend\ServiceManager\ServiceManager;
|
use Zend\ServiceManager\ServiceManager;
|
||||||
|
|
||||||
chdir(dirname(__DIR__));
|
chdir(dirname(__DIR__));
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
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
|
// Build container
|
||||||
$config = require __DIR__ . '/config.php';
|
$config = require __DIR__ . '/config.php';
|
||||||
$container = new ServiceManager($config['dependencies']);
|
$container = new ServiceManager($config['dependencies']);
|
||||||
|
@ -7,14 +7,6 @@ namespace Shlinkio\Shlink\TestUtils;
|
|||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Psr\Container\ContainerInterface;
|
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 */
|
/** @var ContainerInterface $container */
|
||||||
$container = require __DIR__ . '/../container.php';
|
$container = require __DIR__ . '/../container.php';
|
||||||
$testHelper = $container->get(Helper\TestHelper::class);
|
$testHelper = $container->get(Helper\TestHelper::class);
|
||||||
|
@ -6,14 +6,6 @@ namespace Shlinkio\Shlink\TestUtils;
|
|||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
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 */
|
/** @var ContainerInterface $container */
|
||||||
$container = require __DIR__ . '/../container.php';
|
$container = require __DIR__ . '/../container.php';
|
||||||
$container->get(Helper\TestHelper::class)->createTestDb();
|
$container->get(Helper\TestHelper::class)->createTestDb();
|
||||||
|
@ -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
|
||||||
|
@ -3,7 +3,7 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
shlink_nginx:
|
shlink_nginx:
|
||||||
container_name: shlink_nginx
|
container_name: shlink_nginx
|
||||||
image: nginx:1.15.9-alpine
|
image: nginx:1.17.6-alpine
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
volumes:
|
volumes:
|
||||||
@ -37,6 +37,7 @@ services:
|
|||||||
- "9001:9001"
|
- "9001:9001"
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/home/shlink
|
- ./:/home/shlink
|
||||||
|
- ./data/infra/php.ini:/usr/local/etc/php/php.ini
|
||||||
links:
|
links:
|
||||||
- shlink_db
|
- shlink_db
|
||||||
- shlink_db_postgres
|
- shlink_db_postgres
|
||||||
|
Loading…
Reference in New Issue
Block a user