======
$ composer create-project symfony/skeleton <nom_projet>
$ cd <nom_projet>
$ composer require symfony/orm-pack
$ composer require annotations
$ composer require validator
$ composer require template
$ composer require security-bundle
$ composer require --dev maker-bundle
======
$ php bin/console make:controller (puis nommer NomController -> en CamelCase)
$ composer require server --dev
======
$ php bin/console server:run
Pour Mercury :
$ php bin/console server:run --env=dev --docroot=web/
(Puis aller sur http://127.0.0.1:8000 pour votre projet sur le browser comme indiqué)
======
$ php bin/console make:entity (puis nommer Nom)
======
Accéder à mon compte Github :
Username for 'https://github.com': khafidmedheb
Password:xxxxxxx
...(à lancer une 2ème fois si F apparaît dans le résultat) :
$ ./vendor/bin/php-cs-fixer fix --using-cache=no --verbose --diff --rules=@Symfony src
...Remarque : Après le php-cs-fixer, vous risquez de voir des fichiers sur lesquels vous n'avez pas travaillé, dans la zone "stage" (avant git add -A)
-
Stage "all changes" > Titre du commit > Commit
-
Pull
...Remarque "flèches" : ...Si flèche vers le bas sur <ma_branche> -> faire un pull ...Si flèche vers le haut sur <ma_branche> -> faire un push
-
push vers <ma_branche> (je suis sur <ma_branche>)
-
Checkout "dev"
-
Pull (de la dev distante vers ma dev en local)
-
Checkout <ma_branche>
-
Clique droit sur > "Rebase <ma_branche> onto dev"
...Attention : après l'étape 7), 2 flèches "haut" et "bas" apparaissent à côté de <ma_branche>
7bis. Pull (note : pull de <ma_branche> qui a la flèche vers le bas)
7ter. Push (note : push de <ma_branche> qui a la flèche vers le haut)
...Si erreur sur le rebase : cliquer en haut du diagramme central sur "Work in progress" (WP) puis sur "skip commit" (en bas à droite)
-
Clique droit > Merge <ma_branche> into dev
-
Checkout "dev"
-
Push
-
Ne pas oublier : Checkout <ma_branche> avant les prochains développements
- Je suis sur dev, clique "stash" (bannette virtuelle)
- Checkout <ma_branche>
- Rebase <ma_branche> onto dev
- pull et push éventuels sur <ma_branche>
- Clique sur "pop" -> le(s) fichier(s) changé(s) en dev sont remis en attente sur <ma_branche>
======
$ git status
$ git rebase --abort
$ git checkout dev
$ git pull
$ git merge features/<ma_branche>
$ git checkout dev
$ git push
...TODO : A compléter...
======
ma_branche = feature/test_behat_sf4
$ rm .git/refs/remotes/origin/feature/test_behat_sf4
$ git branch --set-upstream-to=origin/feature/test_behat_sf4
$ git pull
$ git mergetool
$ git commit -m "Correction"
$ git push
======
php bin/console fos:user:create user [email protected] 1234
php bin/console fos:user:create admin [email protected] 1234
php bin/console fos:user:promote admin ROLE_ADMIN
Installer Doctrine-Fixtures (pour la création d'un jeu de données -> voir # Chargement de données ... )
======
$ composer require --dev doctrine/doctrine-fixtures-bundle
...(fichier AppFixtures.php créé dans src/Entity/AppFixtures.php)
======
Renseigner "a:1:{i:0;s:16:"ROLE_SUPER_ADMIN";}" dans le champ "roles"
======
mysql -uroot -p (puis entrer votre MDP utilisateur Linux ou autre OS)
GRANT ALL on <nom_base_mysql>.* to <votre_identifiant>@127.0.0.1 identified by '<votre_mot_de_passe>';
======
-> Supprimer les fichiers "Migrations-xxxxx" du dossier src/migrations
-> Vider la table Migrations de notre bases via PhpMyadmin (sauf si on drop la base entière !)
$ php bin/console doctrine:database:drop --force
$ php bin/console doctrine:database:create
$ php bin/console make:migration
-> Ouvrir le fichier src/Migrations/Versionxxxx.php -> Ajouter "$this->addSql('ALTER TABLE type_protocol AUTO_INCREMENT=0');" à la fin de up(Schema...)
$ php bin/console doctrine:migrations:migrate
======
$ php bin/console doctrine:schema:update --force
$ php bin/console doctrine:schema:validate
======
$ php bin/console doctrine:fixtures:load
$ php bin/console doctrine:fixtures:load --append
======
Possibilité d'utiliser aussi le package Faker de Symfony
-> On peut aussi utiliser le bundle Faker pour avoir des données plus réalistes (nom, adresses, textes lorem,...) Lien : https://github.com/fzaninotto/Faker
======
...Modification éventuelle de src/datafixtures/app.fixture en conséquence
$ php bin/console doctrine:fixtures:load
======
$ php bin/console cache:clear
Si erreur mémoire du type : "Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 131072 bytes) " Alors lancer la commande suivante :
$ php -d memory_limit=-1 bin/console cache:clear
======
# Windows : Avec le chromedriver.exe (qu'il faut lancer en cliquant sur le fichier -> voir commande suivante)
======
Pour Seqoia :
$ java -Dwebdriver.chrome.driver=C:/wamp64/www/seqOIA/var/Selenium/chromedriver -jar C:/wamp64/www/seqOIA/var/Selenium/selenium-server-standalone-3.141.59.jar -debug
Pour Ice :
$ java -Dwebdriver.chrome.driver=C:/wamp64/www/ice/var/Selenium/chromedriver -jar C:/wamp64/www/ice/var/Selenium/selenium-server-standalone-3.141.59.jar -debug
$ java -Dwebdriver.chrome.driver=C:/wamp64/www/ice/chromedriver -jar C:/wamp64/www/ice/var/Selenium/selenium-server-standalone-3.141.59.jar -debug
-> On doit voir un serveur (prompt |) en attente avec "INFO - Selenium Server is up and running on port 4444"
Configuration:
$ java -jar C:/wamp64/www/ice/var/Selenium/selenium-server-standalone-3.141.59.jar -role hub -hubConfig C:/wamp64/www/ice/var/Selenium/hub-conf.json
$ java -jar C:/wamp64/www/ice/var/Selenium/selenium-server-standalone-3.141.59.jar -role node -nodeConfig C:/wamp64/www/ice/var/Selenium/win-node-conf.json
$ System.setProperty('Dwebdriver.chrome.driver', 'C:/wamp64/www/ice/var/Selenium/chromedriver');
Puis aller dans C:/wamp64/www/seqOIA/var/Selenium/ et double cliquer sur le fichier chromedriver.exe
Une console Msdos devrait s'ouvrir avec l'invite "Starting ChromeDriver ..."
# Linux (Ubuntu Xenial)
======
======
# (Windows): Run Chrome sans interface (ou headless mode)
======
$ start chrome --disable-gpu -enable-logging --v=0 --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222
$ start chrome --disable-gpu --headless --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --user-data-dir=/data
start chrome --disable-gpu -enable-logging --headless --dump-dom http://127.0.0.1:8000
## (Windows): Run Chrome with interface
======
$ start chrome --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222
# (Linux): Run Chrome sans interface (ou headless mode) -> ma distrib Ubuntu Xenial sur Travis
======
$ google-chrome-stable --no-sandbox --headless --disable-gpu --/prefetch:1 --remote-debugging-port=9222 http://127.0.0.1:8000
======
$ netstat -ano | findstr :4444 -> affiche <your_PID> dans le result
$ tskill <your_PID>
====== erreur du type : "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 12288 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/ DependencyResolver/GenericRule.php on line 36" php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require google/apiclient
$ php -dmemory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar validate
$ php -dmemory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar update
$ php -dmemory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar install
$ php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require <NOM_PACKAGE>
$ php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require lovers-of-behat/table-extension
php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require --dev doctrine/doctrine-fixtures-bundle
======
======
Stages "Travis" : https://medium.com/ubc-launch-pad-software-engineering-blog/optimizing-travis-ci-pipelines-36973aea3758
$ php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require --dev behat/behat $ php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require --dev fabpot/goutte
$ php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require behat/mink --dev
vendor/bin/behat --list-scenarios | ./vendor/liuggio/fastest/fastest "vendor/bin/behat {}" vendor/bin/behat --list-scenarios | ./vendor/liuggio/fastest/fastest "test-behat.sh {}"
======
- Ajouter 5 ans à une date de péremption
UPDATE consommables SET date_peremption = date_peremption + interval '5' year WHERE id = 1;
remove symfony/symfony v3.0.9
vendor/bin/phpmd src text cleancode, codesize, controversial, design, unusedcode
- vendor/bin/phpcpd src
======
Rédiger en markdown : https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
Tests stages (share du cache entre 2 stages)
php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require <NOM_PACKAGE>
php -dmemory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar update rstgroup/behat-oauth2-context
php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar global require behat/behat
Dans le fichier composer.json, ajouter dans "extra": "lbaey/chromedriver": { "bypass-select": true, "chromedriver-version": "2.35" }," comme suit
"extra": { "lbaey/chromedriver": { "bypass-select": true, "chromedriver-version": "2.35" },
"guzzlehttp/guzzle": "~6.0", ...
php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require symfony/console
\192.168.29.3\evry\09-SMQ\3-Ressources-Humaines\Formations
file://192.168.29.3/evry/09-SMQ/3-Ressources-Humaines/Enregistrements/SMQ-ENR-022-R00%20Evaluation%20d'une%20action%20de%20formation.pdf
php -d memory_limit=-1 C:/ProgramData/ComposerSetup/bin/composer.phar require --dev ingenerator/behat-tableassert
whereis -u -M -f *
xterm -e 'cd /c/wamp64/www/ice && /bin/bash'