Subversion Repositories Applications.framework

Compare Revisions

Ignore whitespace Rev 296 → Rev 464

/trunk/doc/genererPhpDoc.sh/genererDoc.sh
1,66 → 1,48
#!/bin/bash
########################################################################################################################
# But : création et mise en ligne automatique sur le serveur par ftp, de la dernière version de la doc du Framework.
# Auteur : Jean-Pascal Milcent <jpm@tela-botanica.org>
# But : création de la PhpDoc du Framework.
# Auteur : Jean-Pascal Milcent <jpm@tela-botanica.org>
# License : GPL v3
# Création : 04 mars 2010
# Version: 0.1
# $Id$
# Exemple : ./genererDoc.sh -h 193.54.123.169 -u telabotaa -p mot_de_passe
# Création : 12 mars 2014
# Version: 2
# Exemple : ./genererPhpDoc.sh "Mon Titre"
########################################################################################################################
# Constante
NBREPARAM=$#
TITRE="Documentation du Framework de Tela Botanica"
SOURCE=/opt/lampp/htdocs/framework/framework
CIBLE=/opt/lampp/htdocs/framework/doc
FTP_CIBLE="/www/doc/framework"
IGNORER=.htaccess,config.ini
FORMAT=HTML:frames:DOM/phpdoc.de,HTML:Smarty:PHP
PACKAGE_DEFAUT="Framework"
CATEGORIE_DEFAUT="php 5.2"
SILENCIEUX="on"
TITRE=""
SOURCE="./../framework"
CIBLE="./PhpDoc"
IGNORER=".htaccess,config.ini"
FORMAT="clean"
 
# Aide
E_OPTERR=65
if [ "$1" = '--help' ]
then # Le script a besoin d'au moins un argument sur la ligne de commande
echo "Usage $0 -[parameters -u, -p ]"
echo "Usage $0 -[parameters -t ]"
echo "Paramétres : "
echo " -h: indiquer l'hote ftp"
echo " -u: indiquer le nom de l'utilisateur ftp"
echo " -p: indiquer le mot de passe de l'utilisateur ftp"
echo " -t: indiquer le titre de la doc"
exit $E_OPTERR
fi
 
# Récupération des paramètres et des options de la ligne de commande
TEMP=`getopt -o u:p:h: -l help: -- "$@"`
TEMP=`getopt -o t: -l help: -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while [ ! -z "$1" ] ; do
#echo $1" # "$2
case "$1" in
-h) HOST=$2;;
-u) FTP_USER=$2;;
-p) FTP_PASSWD=$2;;
-t) TITRE=$2;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
shift 2
shift 2
done
 
# Suppression des dossiers précédent de la doc
if [ -d HTMLframesConverter ]; then
rm -fR HTMLframesConverter
if [ -d PhpDoc ]; then
rm -fR PhpDoc
mkdir PhpDoc
fi;
if [ -d HTMLSmartyConverter ]; then
rm -fR HTMLSmartyConverter
fi;
 
echo "Génération de la documentation :";
/opt/lampp/bin/phpdoc -t $CIBLE -i $IGNORER -o $FORMAT -d $SOURCE -ti $TITRE -s on -dn $PACKAGE_DEFAUT -dc $CATEGORIE_DEFAUT -q $SILENCIEUX
 
if [ $NBREPARAM -eq 0 ]; then
echo "Pas de transfert sur le serveur. Utiliser --help pour voir les options de transfert."
else
echo "Transfert sur le serveur de l'application :";
lftp ftp://$FTP_USER:$FTP_PASSWD@$HOST -e "set ftp:passive off; mirror -e -R -L -x .svn -x genererDoc.sh $CIBLE $FTP_CIBLE ; quit"
fi;
/opt/lampp/bin/php /opt/lampp/bin/phpdoc -d "$SOURCE" -t "$CIBLE" -i "$IGNORER" --template="$FORMAT" --title="$TITRE"