From 4d3c87b01a4646e536db4c8d6203ef684936ecf9 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Thu, 17 Nov 2022 20:25:09 -0800 Subject: [PATCH] updated docs --- README.md | 18 +++++++++++++++++- bash/newProject.bash | 13 +++++++++---- docs/Security.md | 23 ++++++++++++++++++++++- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67f9254..7d86b34 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,20 @@ bash nysymfony YOUR_PROJECT_NAME rm nysymfony cd YOUR_PROJECT_NAME sudo docker-compose up -d -``` \ No newline at end of file +``` + +The next steps to take would be: + +1. Verify the ```.env``` and ```docker-compose.md``` file +1. start docker +1. Create your controllers +1. Create your security + +# Currently supported and tested on + +I am only one man, I can only support the following, issues for other versions will be closed. + +* PHP: 8.1 +* Symfony: 6.1.7 +* Docker: 20.10 +* Mariadb: 10.7 \ No newline at end of file diff --git a/bash/newProject.bash b/bash/newProject.bash index cfcb1e1..74451c5 100644 --- a/bash/newProject.bash +++ b/bash/newProject.bash @@ -131,7 +131,7 @@ echo "DBUSER=theuser${GEN}" >> .env GEN=`echo $RANDOM | md5sum | head -c 12` echo "DBPASSWORD=${GEN}" >> .env echo '' >> .env -echo '# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"' +echo '# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"' >> .env # TODO: move these here after you have symfony production ready @@ -143,6 +143,12 @@ wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/docke echo "Creating a Dockerfile" wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/Dockerfile +################################################################################ +# Clean up +################################################################################ + +composer update + ################################################################################ # Git ################################################################################ @@ -156,7 +162,6 @@ git commit -m"New Project Script Run Completed" php bin/console --version -echo "Symfony Installed" -echo "sudo docker-compose up -d" -echo "For more, go to: https://www.nickyeoman.com" +composer recipes +echo "Symfony Installed" \ No newline at end of file diff --git a/docs/Security.md b/docs/Security.md index d47b0ed..2f4f167 100644 --- a/docs/Security.md +++ b/docs/Security.md @@ -36,16 +36,37 @@ to the firewalls section of config/packages/security.yaml ### Modify the controller ```php -$error = $authenticationUtils->getLastAuthenticationError(); +getLastAuthenticationError(); $lastUsername = $authenticationUtils->getLastUsername(); + return $this->render('login/index.html.twig', [ 'last_username' => $lastUsername, 'error' => $error, ]); + } +} ``` ### Modify the template ```php +{% extends '@nytwig/master.html.twig' %} + +{% block title %}Hello LoginController!{% endblock %} + {% block content %} {% if error %}
{{ error.messageKey|trans(error.messageData, 'security') }}