|
|
|
@ -48,7 +48,7 @@ class PackageStage implements StageInterface
|
|
|
|
|
|
|
|
|
|
if (!$context->has('presentation')) { |
|
|
|
|
$rev = ""; |
|
|
|
|
if ($context->has('git_current')) { |
|
|
|
|
if ($context->has('git')) { |
|
|
|
|
/** @var Git */ |
|
|
|
|
$git = $context->get('git'); |
|
|
|
|
if ($branch = $git->getBranch() and !in_array($branch, ['main', 'master'])) { |
|
|
|
@ -59,27 +59,14 @@ class PackageStage implements StageInterface
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$presentation = 'Cette documentation est issue du code source PHP '; |
|
|
|
|
$presentation = 'Documentation du code PHP '; |
|
|
|
|
$presentation .= match (true) { |
|
|
|
|
$package->is_spip => 'de SPIP '.$package->version.$rev.'.', |
|
|
|
|
$package->is_plugin => 'du plugin « '.$package->name.' », version '.$package->version.$rev.'.', |
|
|
|
|
default => 'de « '.$context->get('title').' »'.$rev.'.', |
|
|
|
|
}; |
|
|
|
|
$presentation .= ' '; |
|
|
|
|
|
|
|
|
|
if (!$package->is_spip or $package->url_documentation or $package->url_development) { |
|
|
|
|
if (!$package->is_spip) { |
|
|
|
|
$presentation .= '- [Description dans l’annuaire des plugins]('.$package->url_package.') '; |
|
|
|
|
} |
|
|
|
|
if ($package->url_documentation) { |
|
|
|
|
$presentation .= '- [Documentation]('.$package->url_documentation.') '; |
|
|
|
|
} |
|
|
|
|
if ($package->url_development) { |
|
|
|
|
$presentation .= '- [Outil de développement]('.$package->url_development.') '; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$context->set('presentation', $presentation); |
|
|
|
|
$context->get('logger')->debug("Presentation: \n". rtrim(str_replace(' ', "\n", $presentation))); |
|
|
|
|
$context->get('logger')->debug('Presentation: ' . $presentation); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|