Skip to content

Commit

Permalink
Merge pull request #136 from thepacer/symfony-5.3
Browse files Browse the repository at this point in the history
Symfony 5.3
  • Loading branch information
stephenyeargin authored Jun 19, 2021
2 parents fc6a046 + 03cf6bf commit 5a9541a
Show file tree
Hide file tree
Showing 52 changed files with 18,350 additions and 19,451 deletions.
14 changes: 7 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=dbab7fbf78ee8d292d61f80729566572
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
APP_SECRET=f9e3fcfafa35b9405562137c73d9b7dc
###< 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
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
# DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

###> aws/aws-sdk-php-symfony ###
Expand Down
4 changes: 3 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='s$cretf0rt3st'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
DATABASE_URL="sqlite:///%kernel.project_dir%/var/app.db"
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/src/.preload.php
/var/
/vendor/
###< symfony/framework-bundle ###
Expand All @@ -23,3 +22,8 @@ yarn-error.log
###< symfony/phpunit-bridge ###

/build/

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
12 changes: 12 additions & 0 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';

// start the Stimulus application
import './bootstrap';
11 changes: 11 additions & 0 deletions assets/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.(j|t)sx?$/
));

// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);
4 changes: 4 additions & 0 deletions assets/controllers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}
16 changes: 16 additions & 0 deletions assets/controllers/hello_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Controller } from 'stimulus';

/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}
3 changes: 3 additions & 0 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: lightgray;
}
40 changes: 7 additions & 33 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,15 @@

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

set_time_limit(0);
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

require dirname(__DIR__).'/vendor/autoload.php';
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
40 changes: 21 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,31 @@
"aws/aws-sdk-php-symfony": "^2.0",
"beberlei/doctrineextensions": "^1.2",
"knplabs/knp-markdown-bundle": "^1.7",
"knplabs/knp-paginator-bundle": "^5.2",
"sensio/framework-extra-bundle": "^5.2",
"knplabs/knp-paginator-bundle": "^5.5",
"sensio/framework-extra-bundle": "^5.3",
"stof/doctrine-extensions-bundle": "^1.4",
"symfony/apache-pack": "^1.0",
"symfony/asset": "^5.2",
"symfony/cache": "^5.2",
"symfony/console": "^5.2",
"symfony/dotenv": "^5.2",
"symfony/asset": "^5.3",
"symfony/cache": "^5.3",
"symfony/console": "^5.3",
"symfony/dotenv": "^5.3",
"symfony/flex": "^1.9.10",
"symfony/form": "^5.2",
"symfony/framework-bundle": "^5.2",
"symfony/http-client": "^5.2",
"symfony/form": "^5.3",
"symfony/framework-bundle": "^5.3",
"symfony/http-client": "^5.3",
"symfony/monolog-bundle": "^3.5",
"symfony/orm-pack": "^2.0",
"symfony/security-bundle": "^5.2",
"symfony/translation": "^5.2",
"symfony/twig-bundle": "^5.2",
"symfony/validator": "^5.2",
"symfony/runtime": "^5.3",
"symfony/security-bundle": "^5.3",
"symfony/translation": "^5.3",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "^5.3",
"symfony/webpack-encore-bundle": "^1.0",
"symfony/yaml": "^5.2",
"symfony/yaml": "^5.3",
"tomodomo/twig-pluralize-extension": "^2.0",
"twig/extensions": "^1.5",
"twig/extra-bundle": "^3.0"
"twig/extra-bundle": "^3.0",
"twig/string-extra": "^3.3"
},
"config": {
"platform": {
Expand Down Expand Up @@ -77,7 +79,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "^5.2"
"require": "^5.3"
}
},
"require-dev": {
Expand All @@ -86,10 +88,10 @@
"phpstan/phpstan": "^0.12.52",
"phpstan/phpstan-doctrine": "^0.12.22",
"phpstan/phpstan-symfony": "^0.12.28",
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/browser-kit": "^5.3",
"symfony/css-selector": "^5.3",
"symfony/maker-bundle": "^1.11",
"symfony/phpunit-bridge": "^5.2",
"symfony/phpunit-bridge": "^5.3",
"symfony/profiler-pack": "^1.0",
"symfony/test-pack": "^1.0"
}
Expand Down
Loading

0 comments on commit 5a9541a

Please sign in to comment.