Skip to content

Commit 68df221

Browse files
committed
Init Symfony 4
1 parent b5ad18b commit 68df221

20 files changed

+1965
-1
lines changed

.env

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the later taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
#
13+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
14+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
15+
16+
###> symfony/framework-bundle ###
17+
APP_ENV=dev
18+
APP_SECRET=ad488326279ad351df59ae2b3f0dc160
19+
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
20+
#TRUSTED_HOSTS='^localhost|example\.com$'
21+
###< symfony/framework-bundle ###

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
###> symfony/framework-bundle ###
2+
/.env.local
3+
/.env.local.php
4+
/.env.*.local
5+
/public/bundles/
6+
/var/
7+
/vendor/
8+
###< symfony/framework-bundle ###
9+
10+
###> symfony/web-server-bundle ###
11+
/.web-server-pid
12+
###< symfony/web-server-bundle ###

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# REST RATP API
1+
# RATP REST API
22

33
v4 - Work in progress

bin/console

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
9+
if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
10+
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
11+
}
12+
13+
set_time_limit(0);
14+
15+
require dirname(__DIR__).'/vendor/autoload.php';
16+
17+
if (!class_exists(Application::class)) {
18+
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
19+
}
20+
21+
$input = new ArgvInput();
22+
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
23+
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
24+
}
25+
26+
if ($input->hasParameterOption('--no-debug', true)) {
27+
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
28+
}
29+
30+
require dirname(__DIR__).'/config/bootstrap.php';
31+
32+
if ($_SERVER['APP_DEBUG']) {
33+
umask(0000);
34+
35+
if (class_exists(Debug::class)) {
36+
Debug::enable();
37+
}
38+
}
39+
40+
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
41+
$application = new Application($kernel);
42+
$application->run($input);

composer.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"type": "project",
3+
"license": "proprietary",
4+
"require": {
5+
"php": "^7.1.3",
6+
"ext-ctype": "*",
7+
"ext-iconv": "*",
8+
"symfony/console": "4.2.*",
9+
"symfony/dotenv": "4.2.*",
10+
"symfony/flex": "^1.1",
11+
"symfony/framework-bundle": "4.2.*",
12+
"symfony/yaml": "4.2.*"
13+
},
14+
"config": {
15+
"preferred-install": {
16+
"*": "dist"
17+
},
18+
"sort-packages": true
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"App\\": "src/"
23+
}
24+
},
25+
"replace": {
26+
"paragonie/random_compat": "2.*",
27+
"symfony/polyfill-ctype": "*",
28+
"symfony/polyfill-iconv": "*",
29+
"symfony/polyfill-php71": "*",
30+
"symfony/polyfill-php70": "*",
31+
"symfony/polyfill-php56": "*"
32+
},
33+
"scripts": {
34+
"auto-scripts": {
35+
"cache:clear": "symfony-cmd",
36+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
37+
},
38+
"post-install-cmd": [
39+
"@auto-scripts"
40+
],
41+
"post-update-cmd": [
42+
"@auto-scripts"
43+
]
44+
},
45+
"conflict": {
46+
"symfony/symfony": "*"
47+
},
48+
"extra": {
49+
"symfony": {
50+
"allow-contrib": false,
51+
"require": "4.2.*"
52+
}
53+
},
54+
"require-dev": {
55+
"symfony/web-server-bundle": "4.2.*"
56+
}
57+
}

0 commit comments

Comments
 (0)