Skip to content

Commit 6c5e2ed

Browse files
authored
Merge pull request #1 from sjeguedes/feature/project-configuration
Feature/project configuration
2 parents e9e98a8 + 7477f61 commit 6c5e2ed

33 files changed

+4577
-0
lines changed

.env.dist

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is a "template" of which env vars need to be defined for your application
2+
# Copy this file to .env file for development, create environment variables when deploying to production
3+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
5+
###> symfony/framework-bundle ###
6+
APP_ENV=dev
7+
APP_SECRET=ffa18a3943e672e66fa18cb17de6079a
8+
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
9+
#TRUSTED_HOSTS=localhost,example.com
10+
###< symfony/framework-bundle ###
11+
12+
###> doctrine/doctrine-bundle ###
13+
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
14+
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
15+
# Configure your db driver and server_version in config/packages/doctrine.yaml
16+
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
17+
###< doctrine/doctrine-bundle ###

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env
4+
/public/bundles/
5+
/var/
6+
/vendor/
7+
###< symfony/framework-bundle ###
8+
9+
###> others ###
10+
/docs/
11+
/.idea/
12+
/public-dev/
13+
14+
.php_cs.cache
15+
###< others ###

bin/console

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
use Symfony\Component\Console\Input\ArgvInput;
7+
use Symfony\Component\Debug\Debug;
8+
use Symfony\Component\Dotenv\Dotenv;
9+
10+
set_time_limit(0);
11+
12+
require __DIR__.'/../vendor/autoload.php';
13+
14+
if (!class_exists(Application::class)) {
15+
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
16+
}
17+
18+
if (!isset($_SERVER['APP_ENV'])) {
19+
if (!class_exists(Dotenv::class)) {
20+
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
21+
}
22+
(new Dotenv())->load(__DIR__.'/../.env');
23+
}
24+
25+
$input = new ArgvInput();
26+
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev', true);
27+
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption('--no-debug', true);
28+
29+
if ($debug) {
30+
umask(0000);
31+
32+
if (class_exists(Debug::class)) {
33+
Debug::enable();
34+
}
35+
}
36+
37+
$kernel = new Kernel($env, $debug);
38+
$application = new Application($kernel);
39+
$application->run($input);

composer.json

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"type": "project",
3+
"license": "proprietary",
4+
"require": {
5+
"php": "^7.1.3",
6+
"ext-ctype": "*",
7+
"ext-iconv": "*",
8+
"sensio/framework-extra-bundle": "^5.2",
9+
"symfony/asset": "^4.1",
10+
"symfony/console": "^4.1",
11+
"symfony/flex": "^1.0",
12+
"symfony/framework-bundle": "^4.1",
13+
"symfony/lts": "^4@dev",
14+
"symfony/orm-pack": "^1.0",
15+
"symfony/twig-bundle": "^4.1",
16+
"symfony/validator": "^4.1",
17+
"symfony/yaml": "^4.1"
18+
},
19+
"require-dev": {
20+
"symfony/dotenv": "^4.1",
21+
"symfony/maker-bundle": "^1.5",
22+
"symfony/profiler-pack": "^1.0"
23+
},
24+
"config": {
25+
"preferred-install": {
26+
"*": "dist"
27+
},
28+
"sort-packages": true
29+
},
30+
"autoload": {
31+
"psr-4": {
32+
"App\\": "src/"
33+
}
34+
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"App\\Tests\\": "tests/"
38+
}
39+
},
40+
"replace": {
41+
"symfony/polyfill-ctype": "*",
42+
"symfony/polyfill-iconv": "*",
43+
"symfony/polyfill-php71": "*",
44+
"symfony/polyfill-php70": "*",
45+
"symfony/polyfill-php56": "*"
46+
},
47+
"scripts": {
48+
"auto-scripts": {
49+
"cache:clear": "symfony-cmd",
50+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
51+
},
52+
"post-install-cmd": [
53+
"@auto-scripts"
54+
],
55+
"post-update-cmd": [
56+
"@auto-scripts"
57+
]
58+
},
59+
"conflict": {
60+
"symfony/symfony": "*"
61+
},
62+
"extra": {
63+
"symfony": {
64+
"allow-contrib": false
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)