-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fcf8cc
commit 791ef8e
Showing
83 changed files
with
5,228 additions
and
3,304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; top-most EditorConfig file | ||
root = true | ||
|
||
; Unix-style newlines | ||
[*] | ||
end_of_line = LF | ||
|
||
[*.php] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# This file is a "template" of which env vars need to be defined for your application | ||
# Copy this file to .env file for development, create environment variables when deploying to production | ||
# 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_SECRET=fe9c38e500fa248ddb8e38b7655ae373 | ||
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2 | ||
#TRUSTED_HOSTS=localhost,example.com | ||
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 an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" | ||
# Configure your db driver and server_version in config/packages/doctrine.yaml | ||
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name | ||
# 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 ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
$fileHeaderComment = <<<COMMENT | ||
This file is part of the Symfony package. | ||
(c) Fabien Potencier <[email protected]> | ||
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') | ||
// exclude files generated by Symfony Flex recipes | ||
->notPath('bin/console') | ||
->notPath('public/index.php') | ||
; | ||
|
||
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_superfluous_phpdoc_tags' => 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') | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
language: php | ||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache/files | ||
- ./bin/.phpunit | ||
|
||
env: | ||
global: | ||
- SYMFONY_PHPUNIT_DIR=./bin/.phpunit | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 7.1.18 | ||
- php: 7.2 | ||
- php: nightly | ||
allow_failures: | ||
- php: nightly | ||
|
||
before_install: | ||
- '[[ "$TRAVIS_PHP_VERSION" == "nightly" ]] || phpenv config-rm xdebug.ini' | ||
- composer self-update | ||
|
||
install: | ||
- composer install | ||
- ./bin/phpunit install | ||
|
||
script: | ||
- ./bin/phpunit | ||
# this checks that the source code follows the Symfony Code Syntax rules | ||
- '[[ "$TRAVIS_PHP_VERSION" == "nightly" ]] || ./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 | ||
# this checks that Doctrine's mapping configurations are valid | ||
- ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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](https://symfony.com/doc/current/contributing/index.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2015-2018 Bob den Otter | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,48 @@ | ||
Bolt 4.0.0 prototype | ||
==================== | ||
Symfony Demo Application | ||
======================== | ||
|
||
Install | ||
------- | ||
The "Symfony Demo Application" is a reference application created to show how | ||
to develop applications following the [Symfony Best Practices][1]. | ||
|
||
- Check out the git repo | ||
- Run `composer install` | ||
Requirements | ||
------------ | ||
|
||
* PHP 7.1.3 or higher; | ||
* PDO-SQLite PHP extension enabled; | ||
* and the [usual Symfony application requirements][2]. | ||
|
||
Set up Database | ||
--------------- | ||
Installation | ||
------------ | ||
|
||
- Configure the connection in `.env` | ||
- Then: | ||
|
||
``` | ||
php bin/console doctrine:database:create | ||
php bin/console doctrine:schema:create | ||
php bin/console doctrine:fixtures:load | ||
```bash | ||
$ composer create-project symfony/symfony-demo | ||
``` | ||
|
||
Run | ||
--- | ||
Usage | ||
----- | ||
|
||
- Run `bin/console server:start` | ||
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>: | ||
|
||
Build assets | ||
------------ | ||
```bash | ||
$ cd symfony-demo/ | ||
$ php bin/console server:run | ||
``` | ||
|
||
Alternatively, you can [configure a web server][3] like Nginx or Apache to run | ||
the application. | ||
|
||
To set up initially, run `yarn install` to get the required dependencies / | ||
`node_modules`. Then: | ||
Tests | ||
----- | ||
|
||
- Run `node_modules/.bin/encore dev --watch` | ||
Execute this command to run tests: | ||
|
||
```bash | ||
$ cd symfony-demo/ | ||
$ ./bin/phpunit | ||
``` | ||
|
||
See the other options by running `node_modules/.bin/encore`. | ||
[1]: https://symfony.com/doc/current/best_practices/index.html | ||
[2]: https://symfony.com/doc/current/reference/requirements.html | ||
[3]: https://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
build: false | ||
clone_depth: 1 | ||
clone_folder: c:\projects\symfony-demo | ||
|
||
cache: | ||
- '%LOCALAPPDATA%\Composer\files' | ||
- '%LOCALAPPDATA%\SymfonyBridge\phpunit' | ||
- c:\projects\symfony-demo\composer.phar | ||
|
||
init: | ||
- SET PATH=c:\php;%PATH% | ||
- SET COMPOSER_NO_INTERACTION=1 | ||
- SET SYMFONY_DEPRECATIONS_HELPER=strict | ||
- SET SYMFONY_PHPUNIT_DIR=%LOCALAPPDATA%\SymfonyBridge\phpunit | ||
- SET ANSICON=121x90 (121x90) | ||
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f | ||
|
||
install: | ||
- mkdir c:\php && cd c:\php | ||
- appveyor DownloadFile https://raw.githubusercontent.com/symfony/binary-utils/master/cacert.pem | ||
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.1.3-Win32-VC14-x86.zip | ||
- 7z x php-7.1.3-Win32-VC14-x86.zip -y >nul | ||
- del /Q *.zip | ||
- cd ext | ||
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.8-7.1-ts-vc14-x86.zip | ||
- 7z x php_apcu-5.1.8-7.1-ts-vc14-x86.zip -y >nul | ||
- del /Q *.zip | ||
- cd .. | ||
- copy /Y php.ini-development php.ini | ||
- echo max_execution_time=1200 >> php.ini | ||
- echo date.timezone="America/Los_Angeles" >> php.ini | ||
- echo extension_dir=ext >> php.ini | ||
- echo zend_extension=php_opcache.dll >> php.ini | ||
- echo opcache.enable_cli=1 >> php.ini | ||
- echo extension=php_openssl.dll >> php.ini | ||
- echo extension=php_apcu.dll >> php.ini | ||
- echo apc.enable_cli=1 >> php.ini | ||
- echo extension=php_intl.dll >> php.ini | ||
- echo extension=php_mbstring.dll >> php.ini | ||
- echo extension=php_fileinfo.dll >> php.ini | ||
- echo extension=php_pdo_sqlite.dll >> php.ini | ||
- echo extension=php_curl.dll >> php.ini | ||
- echo curl.cainfo=c:\php\cacert.pem >> php.ini | ||
- cd c:\projects\symfony-demo | ||
- IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.3.0/composer.phar) | ||
- php composer.phar self-update | ||
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) | ||
- php composer.phar update --no-progress --ansi | ||
- SET COMPOSER_ROOT_VERSION= | ||
- vendor\bin\simple-phpunit install | ||
|
||
test_script: | ||
- cd c:\projects\symfony-demo | ||
- vendor/bin/simple-phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) { | ||
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n"; | ||
exit(1); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) { | ||
putenv('SYMFONY_PHPUNIT_REMOVE='); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_VERSION')) { | ||
putenv('SYMFONY_PHPUNIT_VERSION=6.5'); | ||
} | ||
if (false === getenv('SYMFONY_PHPUNIT_DIR')) { | ||
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit'); | ||
} | ||
if (false === getenv('SYMFONY_DEPRECATIONS_HELPER')) { | ||
// see https://symfony.com/doc/current/components/phpunit_bridge.html#making-tests-fail | ||
putenv('SYMFONY_DEPRECATIONS_HELPER=999999'); | ||
} | ||
|
||
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit'; |
Oops, something went wrong.