Skip to content

Commit

Permalink
Merge github.com:symfony/demo
Browse files Browse the repository at this point in the history
  • Loading branch information
VolCh committed Nov 25, 2017
2 parents cd6edf5 + 001619d commit d94c24b
Show file tree
Hide file tree
Showing 368 changed files with 25,470 additions and 27,921 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
@@ -0,0 +1,10 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
end_of_line = LF

[*.php]
indent_style = space
indent_size = 4
23 changes: 23 additions & 0 deletions .env.dist
@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_DEBUG=1
APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/blog.sqlite
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
41 changes: 34 additions & 7 deletions .gitignore
@@ -1,9 +1,36 @@
/app/bootstrap.php.cache
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
/build/
/node_modules/
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/data
!/var/log
/var/log/*
!var/log/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/public/build/fonts/glyphicons-*
/public/build/images/glyphicons-*

###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
/bin/
/composer.phar
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/web-server-bundle ###
.web-server-pid
###< symfony/web-server-bundle ###

###> friendsofphp/php-cs-fixer ###
.php_cs
.php_cs.cache
###< friendsofphp/php-cs-fixer ###
42 changes: 42 additions & 0 deletions .php_cs.dist
@@ -0,0 +1,42 @@
<?php

$fileHeaderComment = <<<COMMENT
This file is part of the Symfony package.
(c) Fabien Potencier <fabien@symfony.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
COMMENT;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('config')
->exclude('var')
->exclude('public/bundles')
->exclude('public/build')
;

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
;
39 changes: 39 additions & 0 deletions .travis.yml
@@ -0,0 +1,39 @@
language: php
sudo: false

cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit

env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
fast_finish: true
include:
- php: 7.1

before_install:
- phpenv config-rm xdebug.ini
- composer self-update

install:
- composer install
- ./vendor/bin/simple-phpunit install

script:
- ./vendor/bin/simple-phpunit
# this checks that the source code follows the Symfony Code Syntax rules
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
# this checks that the YAML config files contain no syntax errors
- ./bin/console lint:yaml config
# this checks that the Twig template files contain no syntax errors
- ./bin/console lint:twig templates
# this checks that the XLIFF translations contain no syntax errors
- ./bin/console lint:xliff translations
# this checks that the application doesn't use dependencies with known security vulnerabilities
- ./bin/console security:check --end-point=http://security.sensiolabs.org/check_lock
# this checks that the composer.json and composer.lock files are valid
- composer validate --strict
16 changes: 1 addition & 15 deletions CONTRIBUTING.md
Expand Up @@ -4,18 +4,4 @@ Contributing
The Symfony Demo application is an open source project. Contributions made by
the community are welcome. Send us your ideas, code reviews, pull requests and
feature requests to help us improve this project. All contributions must follow
the [usual Symfony contribution requirements](http://symfony.com/doc/current/contributing/index.html).

Web Assets Management
---------------------

This project manages its web assets in a special way to allow them to work
without configuring any option, installing any tool or executing any command.
If your contribution changes CSS styles or JavaScript code in any way, make
sure to regenerate the `web/css/app.css` and `web/js/app.js` files. To do so,
uncomment the Assetic blocks in the `app/Resources/views/base.html.twig` and
execute the following command:

```bash
$ php app/console assetic:dump --no-debug
```
the [usual Symfony contribution requirements](https://symfony.com/doc/current/contributing/index.html).
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2015 Fabien Potencier
Copyright (c) 2015-2017 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
57 changes: 24 additions & 33 deletions README.md
Expand Up @@ -7,7 +7,7 @@ We use official "Symfony Demo Application" to demonstrate basics of Codeception

```
composer install -n
php app/console doctrine:fixtures:load -n --env test
php bin/console doctrine:fixtures:load -n --env test
php bin/codecept run
```

Expand All @@ -21,54 +21,45 @@ to develop Symfony applications following the recommended best practices.
Requirements
------------

* PHP 5.3 or higher;
* PHP 7.1.3 or higher;
* PDO-SQLite PHP extension enabled;
* and the [usual Symfony application requirements](http://symfony.com/doc/current/reference/requirements.html).
* and the [usual Symfony application requirements][1].

Installation
------------

First, install the [Symfony Installer](https://github.com/symfony/symfony-installer)
if you haven't already. Then, install the Symfony Demo Application executing
this command anywhere in your system:
Execute this command to install the project:

```bash
$ symfony demo

# if you're using Windows:
$ php symfony demo
$ composer create-project symfony/symfony-demo
```

If the `demo` command is not available, update your Symfony Installer to the
most recent version executing the `symfony self-update` command.

> **NOTE**
>
> If you can't use the Symfony Installer, download and install the demo
> application using Git and Composer:
>
> $ git clone https://github.com/symfony/symfony-demo
> $ cd symfony-demo/
> $ composer install
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

Usage
-----

If you have PHP 5.4 or higher, there is no need to configure a virtual host
in your web server to access the application. Just use the built-in web server:
There's no need to configure anything to run the application. Just execute this
command to run the built-in web server and access the application in your
browser at <http://localhost:8000>:

```bash
$ cd symfony-demo/
$ php app/console server:run
$ php bin/console server:run
```

This command will start a web server for the Symfony application. Now you can
access the application in your browser at <http://localhost:8000>. You can
stop the built-in web server by pressing `Ctrl + C` while you're in the
terminal.
Alternatively, you can [configure a fully-featured web server][2] like Nginx
or Apache to run the application.

Tests
-----

Execute this command to run tests:

```bash
$ cd symfony-demo/
$ ./vendor/bin/simple-phpunit
```

> **NOTE**
>
> If you're using PHP 5.3, configure your web server to point at the `web/`
> directory of the project. For more details, see:
> http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
[1]: https://symfony.com/doc/current/reference/requirements.html
[2]: https://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
39 changes: 39 additions & 0 deletions app.json
@@ -0,0 +1,39 @@
{
"name": "Symfony Demo Application",
"description": "The official demo application for the Symfony framework.",
"keywords": [
"php",
"symfony"
],
"website": "https://symfony.com/download",
"repository": "https://github.com/symfony/symfony-demo",
"logo": "https://symfony.com/images/v5/pictos/demoapp.svg?v=4",
"success_url": "/",
"scripts": {
"postdeploy": "php bin/console doctrine:schema:create && php bin/console doctrine:fixtures:load -n",
"test-setup": "php bin/console doctrine:schema:create && php bin/console doctrine:fixtures:load -n",
"test": "phpunit"
},
"env": {
"APP_ENV": {
"value": "prod",
"description": "If you want to use the Symfony `dev` environment in the deployed application, you must move the necessary dependencies (like SensioGeneratorBundle) from `require-dev` to `require`. This will introduce security issues because development tools like the WebProfiler reveal sensitive information."
},
"APP_DEBUG": {
"value": "0"
},
"APP_SECRET": {
"description": "Extra entropy for %kernel.secret%; used for CSRF tokens, cookies and signed URLs.",
"generator": "secret"
},
"MAILER_URL": {
"value": "null://localhost",
"description": "A DSN-like configuration string for the mail server. See https://symfony.com/doc/current/reference/configuration/swiftmailer.html#url"
},
"SYMFONY_LOG": "php://stderr"
},
"addons": [
"heroku-postgresql"
],
"image": "heroku/php"
}
7 changes: 0 additions & 7 deletions app/.htaccess

This file was deleted.

9 changes: 0 additions & 9 deletions app/AppCache.php

This file was deleted.

45 changes: 0 additions & 45 deletions app/AppKernel.php

This file was deleted.

0 comments on commit d94c24b

Please sign in to comment.