|
|
|
@ -25,14 +25,6 @@ class PhpDocumentorConfigStage implements StageInterface
|
|
|
|
|
throw new ContextException(sprintf('Key "%s" needs to be defined and instance of Package.', 'package')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
!$context->has('phpdocumentor_template_xml') |
|
|
|
|
or !$context->get('phpdocumentor_template_xml') |
|
|
|
|
or !file_exists($context->get('phpdocumentor_template_xml')) |
|
|
|
|
) { |
|
|
|
|
throw new ContextException(sprintf('Key "%s" needs to be defined with valid file.', 'phpdocumentor_template_xml')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$fs = new Filesystem(); |
|
|
|
|
$package = $context->get('package'); |
|
|
|
|
$prefix = $package->get('prefix') ?: $context->get('default_prefix'); |
|
|
|
@ -60,7 +52,7 @@ class PhpDocumentorConfigStage implements StageInterface
|
|
|
|
|
|
|
|
|
|
// copy templates in config directory |
|
|
|
|
$fs->mirror( |
|
|
|
|
$context->get('templates_directory'), |
|
|
|
|
$context->get('phpdocumentor_config_directory'), |
|
|
|
|
$config_directory . '/.phpdoc', |
|
|
|
|
options: [ |
|
|
|
|
'delete' => true, |
|
|
|
@ -89,7 +81,8 @@ class PhpDocumentorConfigStage implements StageInterface
|
|
|
|
|
'@URL_REPOSITORY@' => $repository, |
|
|
|
|
'@GUIDES_ENABLED@' => ($package->get('with_rst_documentation') ? 'true' : 'false'), |
|
|
|
|
]; |
|
|
|
|
$template = file_get_contents($context->get('phpdocumentor_template_xml')); |
|
|
|
|
$phpdocumentor_template_xml = $context->get('templates_directory') . '/phpdoc.xml'; |
|
|
|
|
$template = file_get_contents($phpdocumentor_template_xml); |
|
|
|
|
$config = str_replace(array_keys($replacements), $replacements, $template); |
|
|
|
|
$config_file = $config_directory . '/phpdoc_' . $prefix . '.xml'; |
|
|
|
|
file_put_contents($config_file, $config); |
|
|
|
|