It's symfony website-skeleton project with some additional tools to validate code standards.
-
GrumPHP, as pre-commit hook, will run 2 tools when
git commit
is run :- PHP_CodeSniffer to check PSR2
- PHPStan will check PHP recommendation
If tests fail, the commit is canceled and a warning message is displayed to developper.
-
Travis CI, as Continuous Integration will be run when a branch with active pull request is updated on github. It will run :
- Tasks to check if vendor, .idea, env.local are not versionned,
- PHP_CodeSniffer to check PSR2,
- PHPStan will check PHP recommendation.
- Check composer is installed
- Check yarn & node are installed
- Clone this project
- Run
composer install
- Run
yarn install
-
Copy paste
.env
in new file.env.local
configure your mysql database -
Run
php bin/console doctrine:migration:migrate
to set the database -
Run
php bin/console doctrine:fixtures:load
to load fixtures (make sur you have Faker required, if you don't, Runcomposer req --dev fzaninotto/faker
) -
Run
symfony server:start
to launch your local php web server -
Run
yarn run dev
to launch your local server for assets
- Run
./bin/phpcs
to launch PHP code sniffer - Run
./bin/phpstan analyse src --level max
to launch PHPStan - Run
./bin/phpmd src text phpmd.xml
to launch PHP Mess Detector - Run
./bin/eslint assets/js
to launch ESLint JS linter - Run
./bin/sass-lint -c sass-linter.yml
to launch Sass-lint SASS/CSS linter
If you develop on Windows, you should edit you git configuration to change your end of line rules with this command :
git config --global core.autocrlf true
=> Prerequisites : 1. Check composer is installed 2. Check yarn & node are installed
- Clone this project
- Run
composer install
- Run
yarn install
- Copy paste
.env
in new file.env.local
- configure your mysql database
- configure your app id and secret foreach social network
- configure your MailerDNS
- Run
php bin/console doctrine:database:create
to create the database - Run
php bin/console doctrine:migration:migrate
to set the database - Run
php bin/console doctrine:fixtures:load --group=groupProd
to load fixtures - Run
yarn encore production
to build assets, css and js - Start the server Add additional notes about how to deploy this on a live system
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Functionality for deleting users whose accounts are older than the desired number of days (100 by default)
The command to run in the terminal, so as to launch the old accounts deleting is :
$ php bin/console app:delete-old-accounts
CAUTION : So as to be fully operational, it requires to use the cron program on the server :
to open and edit cron actions in crantab file, run :
$ crontab -e
add this line at the end of the file (this will delete old acounts every days at 22h00) :
00 22 * * * php bin/console app:delete-old-accounts
Set up your app on : https://developers.google.com/ https://www.linkedin.com/developers/ https://developers.facebook.com/apps/
Get your app id and secret foreach social network and set up in .env.local file
Change mail informations in src/Controller/ResetPasswordController.php line 183
1 / Set up your MAILER_DSN in .env
MAILER_DSN=gmail://USERNAME:PASSWORD@default
2 / configure the options of your Google account and check the "Allow less secure applications: https://myaccount.google.com/lesssecureapps