Modification de la doc
This commit is contained in:
parent
7151321bd9
commit
a6a489403c
@ -10,19 +10,50 @@ générer la documentation automatiquement.
|
||||
* Supprime les retours chariots.
|
||||
* Récupére les éléments de documentation
|
||||
*/
|
||||
$docBlock = preg_replace('/\n/', '', $property->getDocComment() );
|
||||
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+/m', $docBlock, $docBlockMatches)) {
|
||||
//Suppression tabulation et autres
|
||||
$comment = preg_replace(
|
||||
array('/\r/','/\t\s\*/'),
|
||||
array('',''), $docBlockMatches[1]
|
||||
);
|
||||
// Ajout des éléments de documentation au WSDL
|
||||
$annotation = $dom->createElement('xsd:annotation');
|
||||
$documentation = $dom->createElement('xsd:documentation', trim($comment));
|
||||
$annotation->appendChild($documentation);
|
||||
$element->appendChild($annotation);
|
||||
}
|
||||
$comment = '';
|
||||
$docBlock = preg_replace('/\n/', '', $property->getDocComment() );
|
||||
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+/m', $docBlock, $docBlockMatches)) {
|
||||
//Suppression tabulation et autres
|
||||
$comment = preg_replace(
|
||||
array('/\r/', '/\t\s\*/', '/@ref\s+[^\s]+/'),
|
||||
array('', '', ''), $docBlockMatches[1]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Traitement des références
|
||||
* @ref fichier:titre:nom_du_fichier
|
||||
* => http://vhost/ref/fichier/
|
||||
* @ref mysql:titre:db.table(col1,col2,....)
|
||||
* => http://vhost/ref/table/
|
||||
*/
|
||||
if (preg_match_all('/@ref\s+(fichier|mysql):([^\s]+):([^\s]+)/m', $property->getDocComment(), $refMatches, PREG_SET_ORDER)){
|
||||
$host = 'http://scoresws.sd.dev';
|
||||
$urlFichier = '/ref/fichier/';
|
||||
$urlMysql = '/ref/table/';
|
||||
|
||||
foreach ($refMatches as $ref){
|
||||
switch ($ref[0]){
|
||||
case 'fichier':
|
||||
$comment.= $ref[1].'('.$host.$urlFichier.'?q='.$ref[2].')';
|
||||
break;
|
||||
case 'mysql':
|
||||
$comment.= $ref[1].'('.$host.$urlMysql.'?q='.base64_encode($ref[2]).')';
|
||||
break;
|
||||
}
|
||||
$comment.= ', ';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajout des éléments de documentation au WSDL
|
||||
*/
|
||||
if (!empty($comment)){
|
||||
$annotation = $dom->createElement('xsd:annotation');
|
||||
$documentation = $dom->createElement('xsd:documentation', trim($comment));
|
||||
$annotation->appendChild($documentation);
|
||||
$element->appendChild($annotation);
|
||||
}
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
|
Loading…
Reference in New Issue
Block a user