dev-master
9999999-dev
The Requires
- php >=5.4.0
- hoa/core ~2.0
- hoa/console ~2.0
- hoa/http ~0.0
- hoa/router ~2.0
- hoa/view ~2.0
- hoa/dispatcher ~0.0
- hoa/session ~0.0
- hoa/file ~0.0
- hoa/registry ~2.0
- hoa/stringbuffer ~0.0
The Development Requires
PHP framework based on Hoa, (*1)
Sohoa/Framework respecte PSR1 et PSR2 comme convention de codage. Pour faciliter le travail nous utilisons l'outil PHP-CS-Fixer permet de vérifier et corriger automatiquement le code qui ne respecte pas les standards PSR1 et 2. Avec la ligne de commande suivante :, (*2)
php /path/to/php-cs-fixer.php fix /path/to/the/framework
On peut également ajouter cette vérification en hook de pre-commit pour Git. Il faut pour cela ajouter dans le dossier .git du dépÎt local dans le fichier pre-commit
une grande partie du code a été trouvé chez LilaConcepts, (*3)
#!/bin/sh PROJECTROOT=`echo $(cd ${0%/*}/../../ && pwd -P)`/ FIXER=php-cs-fixer.phar if [ ! -e ${PROJECTROOT}${FIXER} ]; then echo "PHP-CS-Fixer not available, downloading to ${PROJECTROOT}${FIXER}..." curl -s http://cs.sensiolabs.org/get/$FIXER > ${PROJECTROOT}${FIXER} echo "Done. First time to check the Coding Standards." echo "" fi RES=`php ${PROJECTROOT}${FIXER} fix $PROJECTROOT --verbose --dry-run` if [ "$RES" != "" ]; then echo "Coding standards are not correct, cancelling your commit." echo "" echo $RES echo "" echo "If you want to fix them run:" echo "" echo " php ${PROJECTROOT}${FIXER} fix ${PROJECTROOT} --verbose" echo "" exit 1 fi
Pour commiter sans passer par le hook on peut utiliser la ligne de commande suivante :, (*4)
git commit -m "message" --no-verify