Skip to content

Commit b14e8ad

Browse files
committed
initial version, with codeception and modules installed
0 parents  commit b14e8ad

File tree

245 files changed

+45442
-0
lines changed

Some content is hidden

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

245 files changed

+45442
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
end_of_line = LF
7+
8+
[*.php]
9+
indent_style = space
10+
indent_size = 4

.env

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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=dev
18+
APP_SECRET=2ca64f8d83b9e89f5f19d672841d6bb8
19+
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
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=sqlite:///%kernel.project_dir%/data/database.sqlite
28+
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7",
29+
# DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
30+
###< doctrine/doctrine-bundle ###
31+
32+
###> symfony/mailer ###
33+
# MAILER_DSN=smtp://localhost
34+
###< symfony/mailer ###

.env.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
7+
DATABASE_URL=sqlite:///%kernel.project_dir%/data/database_test.sqlite

.github/workflows/lint.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: "Lint"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
fail-fast: true
11+
12+
jobs:
13+
php-cs-fixer:
14+
name: PHP-CS-Fixer
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: "Checkout code"
18+
uses: actions/checkout@v2
19+
20+
- name: PHP-CS-Fixer
21+
uses: docker://oskarstark/php-cs-fixer-ga
22+
with:
23+
args: --diff --dry-run
24+
25+
linters:
26+
name: Linters
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
php-version: ['8.1']
31+
32+
steps:
33+
- name: "Checkout code"
34+
uses: actions/[email protected]
35+
36+
- name: "Install PHP with extensions"
37+
uses: shivammathur/[email protected]
38+
with:
39+
coverage: "none"
40+
extensions: intl
41+
php-version: ${{ matrix.php-version }}
42+
tools: composer:v2
43+
44+
- name: "Set composer cache directory"
45+
id: composer-cache
46+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
47+
48+
- name: "Cache composer"
49+
uses: actions/[email protected]
50+
with:
51+
path: ${{ steps.composer-cache.outputs.dir }}
52+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}
53+
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
54+
55+
- name: "Composer install"
56+
run: composer install --no-interaction --no-progress
57+
58+
- name: Install PHPUnit
59+
id: install
60+
run: vendor/bin/simple-phpunit install
61+
62+
- name: Lint YAML files
63+
if: always() && steps.install.outcome == 'success'
64+
run: ./bin/console lint:yaml config --parse-tags
65+
66+
- name: Lint Twig templates
67+
if: always() && steps.install.outcome == 'success'
68+
run: ./bin/console lint:twig templates --env=prod
69+
70+
- name: Lint XLIFF translations
71+
if: always() && steps.install.outcome == 'success'
72+
run: ./bin/console lint:xliff translations
73+
74+
- name: Lint Parameters and Services
75+
if: always() && steps.install.outcome == 'success'
76+
run: ./bin/console lint:container --no-debug
77+
78+
- name: Lint Doctrine entities
79+
if: always() && steps.install.outcome == 'success'
80+
run: ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction
81+
82+
- name: Lint Composer config
83+
if: always() && steps.install.outcome == 'success'
84+
run: composer validate --strict
85+
86+
- name: Download Symfony CLI
87+
if: always() && steps.install.outcome == 'success'
88+
run: wget https://get.symfony.com/cli/installer -O - | bash
89+
90+
- name: Check if any dependencies are compromised
91+
if: always() && steps.install.outcome == 'success'
92+
run: /home/runner/.symfony/bin/symfony check:security
93+
94+
- name: Run PHPStan
95+
if: always() && steps.install.outcome == 'success'
96+
run: ./vendor/bin/phpstan analyze

.github/workflows/tests.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
fail-fast: true
11+
PHPUNIT_FLAGS: "-v"
12+
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit"
13+
SYMFONY_REQUIRE: ">=6.0"
14+
SYMFONY_DEPRECATIONS_HELPER: 7
15+
16+
jobs:
17+
test:
18+
name: "${{ matrix.operating-system }} / PHP ${{ matrix.php-version }}"
19+
runs-on: ${{ matrix.operating-system }}
20+
continue-on-error: false
21+
22+
strategy:
23+
matrix:
24+
operating-system: ['ubuntu-latest']
25+
php-version: ['8.1']
26+
include:
27+
- operating-system: 'macos-latest'
28+
php-version: '8.1'
29+
- operating-system: 'windows-latest'
30+
php-version: '8.1'
31+
32+
steps:
33+
- name: "Checkout code"
34+
uses: actions/[email protected]
35+
36+
- name: "Install PHP with extensions"
37+
uses: shivammathur/[email protected]
38+
with:
39+
coverage: "none"
40+
extensions: "intl, mbstring, pdo_sqlite"
41+
php-version: ${{ matrix.php-version }}
42+
tools: composer:v2
43+
44+
- name: "Add PHPUnit matcher"
45+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
46+
47+
- name: "Set composer cache directory"
48+
id: composer-cache
49+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
50+
51+
- name: "Cache composer"
52+
uses: actions/[email protected]
53+
with:
54+
path: ${{ steps.composer-cache.outputs.dir }}
55+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
56+
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
57+
58+
- name: "Require symfony/flex"
59+
run: composer require --no-progress --no-scripts --no-plugins symfony/flex
60+
61+
- name: "Install dependencies"
62+
run: composer update --no-interaction --prefer-dist --optimize-autoloader
63+
64+
- name: "Install PHPUnit"
65+
run: vendor/bin/simple-phpunit install
66+
67+
- name: "PHPUnit version"
68+
run: vendor/bin/simple-phpunit --version
69+
70+
- name: "Run tests"
71+
run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }}

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/public/build/fonts/glyphicons-*
2+
/public/build/images/glyphicons-*
3+
4+
.php-version
5+
6+
###> symfony/framework-bundle ###
7+
/.env.local
8+
/.env.local.php
9+
/.env.*.local
10+
/config/secrets/prod/prod.decrypt.private.php
11+
/public/bundles/
12+
/var/
13+
/vendor/
14+
###< symfony/framework-bundle ###
15+
16+
###> symfony/phpunit-bridge ###
17+
.phpunit.result.cache
18+
/phpunit.xml
19+
###< symfony/phpunit-bridge ###
20+
###> symfony/webpack-encore-bundle ###
21+
/node_modules/
22+
npm-debug.log
23+
yarn-error.log
24+
###< symfony/webpack-encore-bundle ###
25+
26+
###> phpunit/phpunit ###
27+
/phpunit.xml
28+
.phpunit.result.cache
29+
###< phpunit/phpunit ###

.php-cs-fixer.dist.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
$fileHeaderComment = <<<COMMENT
4+
This file is part of the Symfony package.
5+
6+
(c) Fabien Potencier <[email protected]>
7+
8+
For the full copyright and license information, please view the LICENSE
9+
file that was distributed with this source code.
10+
COMMENT;
11+
12+
$finder = PhpCsFixer\Finder::create()
13+
->in(__DIR__)
14+
->exclude('config')
15+
->exclude('var')
16+
->exclude('public/bundles')
17+
->exclude('public/build')
18+
// exclude files generated by Symfony Flex recipes
19+
->notPath('bin/console')
20+
->notPath('public/index.php')
21+
;
22+
23+
return (new PhpCsFixer\Config())
24+
->setRiskyAllowed(true)
25+
->setRules([
26+
'@Symfony' => true,
27+
'@Symfony:risky' => true,
28+
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
29+
'linebreak_after_opening_tag' => true,
30+
'mb_str_functions' => true,
31+
'no_php4_constructor' => true,
32+
'no_unreachable_default_argument_value' => true,
33+
'no_useless_else' => true,
34+
'no_useless_return' => true,
35+
'php_unit_strict' => true,
36+
'phpdoc_order' => true,
37+
'strict_comparison' => true,
38+
'strict_param' => true,
39+
])
40+
->setFinder($finder)
41+
->setCacheFile(__DIR__.'/var/.php_cs.cache')
42+
;

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Contributing
2+
============
3+
4+
The Symfony Demo application is an open source project. Contributions made by
5+
the community are welcome. Send us your ideas, code reviews, pull requests and
6+
feature requests to help us improve this project. All contributions must follow
7+
the [usual Symfony contribution requirements](https://symfony.com/doc/current/contributing/index.html).

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Symfony Demo Application
2+
========================
3+
4+
The "Symfony Demo Application" is a reference application created to show how
5+
to develop applications following the [Symfony Best Practices][1].
6+
7+
You can also learn about these practices in [the official Symfony Book][5].
8+
9+
Requirements
10+
------------
11+
12+
* PHP 8.1.0 or higher;
13+
* PDO-SQLite PHP extension enabled;
14+
* and the [usual Symfony application requirements][2].
15+
16+
Installation
17+
------------
18+
19+
[Download Symfony][4] to install the `symfony` binary on your computer and run
20+
this command:
21+
22+
```bash
23+
$ symfony new --demo my_project
24+
```
25+
26+
Alternatively, you can use Composer:
27+
28+
```bash
29+
$ composer create-project symfony/symfony-demo my_project
30+
```
31+
32+
If you want to test the demo without installing anything locally, you can also
33+
deploy it on Platform.sh, the official Symfony PaaS:
34+
35+
<p align="center">
36+
<a href="https://console.platform.sh/projects/create-project?template=https://github.com/raw/symfonycorp/platformsh-symfony-template-metadata/main/template-metadata-demo.yaml&utm_content=symfonycorp&utm_source=github&utm_medium=button&utm_campaign=deploy_on_platform"><img src="https://platform.sh/images/deploy/lg-blue.svg" alt="Deploy on Platform.sh" width="180px" /></a>
37+
</p>
38+
39+
Usage
40+
-----
41+
42+
There's no need to configure anything to run the application. If you have
43+
[installed Symfony][4] binary, run this command:
44+
45+
```bash
46+
$ cd my_project/
47+
$ symfony serve
48+
```
49+
50+
Then access the application in your browser at the given URL (<https://localhost:8000> by default).
51+
52+
If you don't have the Symfony binary installed, run `php -S localhost:8000 -t public/`
53+
to use the built-in PHP web server or [configure a web server][3] like Nginx or
54+
Apache to run the application.
55+
56+
Tests
57+
-----
58+
59+
Execute this command to run tests:
60+
61+
```bash
62+
$ cd my_project/
63+
$ ./bin/phpunit
64+
```
65+
66+
[1]: https://symfony.com/doc/current/best_practices.html
67+
[2]: https://symfony.com/doc/current/setup.html#technical-requirements
68+
[3]: https://symfony.com/doc/current/setup/web_server_configuration.html
69+
[4]: https://symfony.com/download
70+
[5]: https://symfony.com/book

0 commit comments

Comments
 (0)