Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 16bf473

Browse files
committed
Initial commit
0 parents  commit 16bf473

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+11090
-0
lines changed

.editorconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
charset = utf-8
7+
end_of_line = LF
8+
insert_final_newline = false
9+
trim_trailing_whitespace = true
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{js,jsx,ts,tsx}]
14+
indent_size = 2
15+
16+
[*.{json,lock}]
17+
indent_size = 2
18+
19+
[*.{css,scss}]
20+
indent_size = 2
21+
22+
[*.sh]
23+
indent_style = tab
24+
tab_width = 4
25+
26+
[*.md]
27+
indent_style = tab
28+
trim_trailing_whitespace = false
29+
tab_width = 4
30+
31+
[*.{yml,yaml}]
32+
indent_size = 2
33+
34+
[*.xml]
35+
indent_style = tab
36+
tab_width = 4
37+
38+
[{Makefile.*,makefile,Makefile,GNUmakefile,*.mk}]
39+
indent_style = tab
40+
tab_width = 4
41+
42+
[COMMIT_EDITMSG]
43+
max_line_length = 0

.env

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter 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.html#use-environment-variables-for-infrastructure-configuration
15+
16+
###> symfony/framework-bundle ###
17+
APP_ENV=prod
18+
APP_SECRET=90b8b29bdd1babbcaafde6a1e2b7b15b
19+
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
20+
#TRUSTED_HOSTS='^localhost|example\.com$'
21+
###< symfony/framework-bundle ###
22+
23+
###> doctrine/doctrine-bundle ###
24+
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
25+
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
26+
#
27+
# DATABASE_URL="mysql://db_user:db_password@localhost:3306/db_name?serverVersion=8.0"
28+
# DATABASE_URL="postgresql://symfony:ChangeMe@localhost:5432/app?serverVersion=14&charset=utf8"
29+
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
30+
###< doctrine/doctrine-bundle ###

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
###> symfony/framework-bundle ###
2+
/config/secrets/*
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###
11+
12+
###> lexik/jwt-authentication-bundle ###
13+
/config/jwt/*.pem
14+
###< lexik/jwt-authentication-bundle ###
15+
16+
###> vich/uploader-bundle ###
17+
!public/images/*/.gitignore
18+
public/images/*
19+
###< vich/uploader-bundle ###

.php-cs-fixer.dist.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
$finder = PhpCsFixer\Finder::create()
3+
->in(__DIR__)
4+
->exclude('config')
5+
->exclude('var')
6+
->exclude('public/bundles')
7+
->exclude('public/build')
8+
// exclude files generated by Symfony Flex recipes
9+
->notPath('bin/console')
10+
->notPath('public/index.php')
11+
;
12+
13+
// https://cs.symfony.com/doc/rules/
14+
return (new PhpCsFixer\Config)
15+
->setRiskyAllowed(true)
16+
->setRules([
17+
'@Symfony' => true,
18+
'@Symfony:risky' => true,
19+
'array_syntax' => ['syntax' => 'short'],
20+
'blank_line_after_opening_tag' => false,
21+
'linebreak_after_opening_tag' => true,
22+
'lowercase_cast' => false,
23+
'mb_str_functions' => true,
24+
'native_function_invocation' => false,
25+
'native_constant_invocation' => false,
26+
'new_with_braces' => false,
27+
'no_php4_constructor' => true,
28+
'no_unreachable_default_argument_value' => true,
29+
'no_useless_else' => true,
30+
'no_useless_return' => true,
31+
'ordered_class_elements' => [], // Remove 'use_trait'
32+
'ordered_imports' => true,
33+
'phpdoc_summary' => false, // In comments: add useless "." at ending and make urls in error
34+
'php_unit_strict' => true,
35+
'phpdoc_order' => true,
36+
'semicolon_after_instruction' => true,
37+
'single_blank_line_before_namespace' => false,
38+
'single_import_per_statement' => false,
39+
'single_trait_insert_per_statement' => false,
40+
'strict_comparison' => true,
41+
'strict_param' => true,
42+
])
43+
->setFinder($finder)
44+
->setCacheFile(__DIR__.'/var/cache/.php_cs.cache')
45+
;

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# POC Symfony 6
2+
Description for the poc (to completed).
3+
4+
**Instructions for the construction of this repot** (to be removed in the poc): This package does not propose by default, some libraries because they do not seem useful for the majority of the pocs. However, you can install them manually if needed. Examples:
5+
6+
* HttpClient: `composer require symfony/http-client`
7+
* Mailer: `composer require symfony/mailer`
8+
* Notifier: `composer require symfony/notifier`
9+
* TestUnits: `composer require --dev symfony/test-pack`
10+
11+
12+
## Prerequisites
13+
14+
* The PHP version must be greater than or equal to PHP 8.2
15+
* The SQLite 3 extension must be enabled
16+
* The JSON extension must be enabled
17+
* The Ctype extension must be enabled
18+
* The date.timezone parameter must be defined in php.ini
19+
20+
More information on [symfony website](https://symfony.com/doc/6.2/reference/requirements.html).
21+
22+
23+
## Installation
24+
Command lines:
25+
26+
```bash
27+
# clone current repot
28+
composer install
29+
30+
# (optional) Copy and edit configuration values ".env.local"
31+
32+
php bin/console doctrine:database:create
33+
php bin/console doctrine:migrations:migrate -n
34+
35+
# Optional
36+
php bin/console doctrine:fixtures:load -n
37+
```
38+
39+
For the asset symlink install, launch a terminal on administrator in Windows environment.
40+
41+
## Usage
42+
Just execute this command to run the built-in web server _(require [symfony installer](https://symfony.com/download))_ and access the application in your browser at <http://localhost:8000>:
43+
44+
```bash
45+
# Dev env
46+
symfony server:start
47+
48+
# Test env
49+
APP_ENV=test php -d variables_order=EGPCS -S 127.0.0.1:8000 -t public/
50+
```
51+
52+
Alternatively, you can [configure a web server](https://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html) like Nginx or Apache to run the application.
53+
54+
Your commit is checked by several dev tools (like phpstan, php cs fixer...). These tools were managed by [Grumphp](https://github.com/phpro/grumphp), you can edit configuration on file [grumphp.yml](./grumphp.yml) or check manually with the command: `./vendor/bin/grumphp run`.

bin/console

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env php
2+
<?php
3+
use App\Kernel;
4+
use Symfony\Bundle\FrameworkBundle\Console\Application;
5+
6+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
7+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
8+
}
9+
10+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
11+
12+
return function (array $context) {
13+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
14+
15+
return new Application($kernel);
16+
};

composer.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"name": "jgauthi/template_symfony_starterpack",
3+
"description": "Symfony with some entities and base controller for create POC",
4+
"type": "project",
5+
"license": "GPL-3.0-only",
6+
"require": {
7+
"php": ">=8.2",
8+
"ext-ctype": "*",
9+
"ext-iconv": "*",
10+
"ext-simplexml": "*",
11+
"doctrine/annotations": "*",
12+
"doctrine/doctrine-bundle": "*",
13+
"doctrine/doctrine-migrations-bundle": "*",
14+
"doctrine/orm": "2.*",
15+
"knplabs/knp-paginator-bundle": "*",
16+
"symfony/asset": "*",
17+
"symfony/console": "*",
18+
"symfony/dotenv": "*",
19+
"symfony/expression-language": "*",
20+
"symfony/flex": "^2",
21+
"symfony/form": "*",
22+
"symfony/framework-bundle": "*",
23+
"symfony/intl": "*",
24+
"symfony/monolog-bundle": "3.*",
25+
"symfony/process": "*",
26+
"symfony/property-access": "*",
27+
"symfony/property-info": "*",
28+
"symfony/proxy-manager-bridge": "*",
29+
"symfony/runtime": "*",
30+
"symfony/security-bundle": "*",
31+
"symfony/serializer": "*",
32+
"symfony/string": "*",
33+
"symfony/translation": "*",
34+
"symfony/twig-bundle": "*",
35+
"symfony/validator": "*",
36+
"symfony/web-link": "*",
37+
"symfony/yaml": "*",
38+
"twig/extra-bundle": "^2.12|^3.0",
39+
"twig/twig": "^2.12|^3.0",
40+
"vich/uploader-bundle": "1.*"
41+
},
42+
"require-dev": {
43+
"doctrine/doctrine-fixtures-bundle": "*",
44+
"fakerphp/faker": "1.*",
45+
"friendsofphp/php-cs-fixer": "*",
46+
"php-parallel-lint/php-parallel-lint": "^1.3",
47+
"phpro/grumphp-shim": "1.*",
48+
"phpstan/phpstan-doctrine": "*",
49+
"phpstan/phpstan-symfony": "*",
50+
"symfony/debug-bundle": "*",
51+
"symfony/maker-bundle": "1.*",
52+
"symfony/stopwatch": "*",
53+
"symfony/var-dumper": "*",
54+
"symfony/web-profiler-bundle": "*"
55+
},
56+
"config": {
57+
"allow-plugins": {
58+
"composer/package-versions-deprecated": true,
59+
"phpro/grumphp-shim": true,
60+
"symfony/flex": true,
61+
"symfony/runtime": true
62+
},
63+
"optimize-autoloader": true,
64+
"preferred-install": {
65+
"*": "dist"
66+
},
67+
"sort-packages": true
68+
},
69+
"autoload": {
70+
"psr-4": {
71+
"App\\": "src/"
72+
}
73+
},
74+
"replace": {
75+
"paragonie/random_compat": "2.*",
76+
"symfony/polyfill-ctype": "*",
77+
"symfony/polyfill-iconv": "*",
78+
"symfony/polyfill-php73": "*",
79+
"symfony/polyfill-php72": "*",
80+
"symfony/polyfill-php71": "*"
81+
},
82+
"scripts": {
83+
"auto-scripts": {
84+
"cache:clear": "symfony-cmd",
85+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
86+
},
87+
"post-install-cmd": [
88+
"@auto-scripts"
89+
],
90+
"post-update-cmd": [
91+
"@auto-scripts"
92+
]
93+
},
94+
"conflict": {
95+
"symfony/symfony": "*"
96+
},
97+
"extra": {
98+
"symfony": {
99+
"allow-contrib": false,
100+
"require": "6.2.*"
101+
}
102+
},
103+
"authors": [
104+
{ "name": "jgauthi", "homepage": "https://github.com/jgauthi", "role": "Developer" }
105+
]
106+
}

0 commit comments

Comments
 (0)