Browse Source

Des renommages sur des noms de répertoire

master
Matthieu Marcillaud 1 year ago
parent
commit
3027e1a6ff
  1. 2
      README.md
  2. 0
      phpdoc/template/components/sidebar.html.twig
  3. 0
      phpdoc/template/components/sidebar_origin.html.twig
  4. 0
      phpdoc/template/css/custom.css.twig
  5. 0
      phpdoc/template/css/variables.css.twig
  6. 0
      phpdoc/template/icons/constant.svg.twig
  7. 0
      phpdoc/template/icons/method.svg.twig
  8. 2
      src/Checkout.php
  9. 4
      src/Command/FromPlugin.php
  10. 4
      src/Command/FromSpip.php
  11. 2
      src/Command/FromZone.php
  12. 4
      src/Context.php
  13. 13
      src/Stage/PhpDocumentorConfigStage.php
  14. 0
      templates/index.html
  15. 0
      templates/phpdoc.xml

2
README.md

@ -63,7 +63,7 @@ Forcer un préfixe de sortie ici dans `work/output/spip-dev` :
### from:spip
Générer la documentation depuis le svn du core
Générer la documentation depuis le git du core
autodoc from:spip
autodoc from:spip --branche=4.0

0
templates/template/components/sidebar.html.twig → phpdoc/template/components/sidebar.html.twig vendored

0
templates/template/components/sidebar_origin.html.twig → phpdoc/template/components/sidebar_origin.html.twig vendored

0
templates/template/css/custom.css.twig → phpdoc/template/css/custom.css.twig vendored

0
templates/template/css/variables.css.twig → phpdoc/template/css/variables.css.twig vendored

0
templates/template/icons/constant.svg.twig → phpdoc/template/icons/constant.svg.twig vendored

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

0
templates/template/icons/method.svg.twig → phpdoc/template/icons/method.svg.twig vendored

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

2
src/Checkout.php

@ -48,7 +48,7 @@ class Checkout
*/
public function readGit(): Git
{
// Ici, on a les bons fichiers SVN à jour
// Ici, on a les bons fichiers Git à jour
// on récupère le numéro de dernière révision
if ($res = $this->read()) {
$res = trim($res[0]);

4
src/Command/FromPlugin.php

@ -1,7 +1,7 @@
<?php
/*
* Commande d'exécution depuis un plugin svn de la Zone de SPIP…
* Commande d'exécution depuis un plugin git de la Zone de SPIP…
*/
namespace Spip\Autodoc\Command;
@ -10,7 +10,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
/**
* Déclaration et exécution de l'application depuis le svn d'un plugin de la zone de SPIP
* Déclaration et exécution de l'application depuis le git d'un plugin de la zone de SPIP
*/
class FromPlugin extends FromGit
{

4
src/Command/FromSpip.php

@ -1,7 +1,7 @@
<?php
/*
* Commande d'exécution depuis une source svn du core de SPIP…
* Commande d'exécution depuis une source git du core de SPIP…
*/
namespace Spip\Autodoc\Command;
@ -18,7 +18,7 @@ use Spip\Autodoc\Stage\PhpDocumentorStage;
use Symfony\Component\Console\Input\InputOption;
/**
* Déclaration et exécution de l'application depuis le svn du core de SPIP
* Déclaration et exécution de l'application depuis le git du core de SPIP
*/
class FromSpip extends FromGit
{

2
src/Command/FromZone.php

@ -1,7 +1,7 @@
<?php
/*
* Commande d'exécution depuis une source svn de la Zone de SPIP…
* Commande d'exécution depuis une source git de la Zone de SPIP…
*/
namespace Spip\Autodoc\Command;

4
src/Context.php

@ -21,11 +21,11 @@ class Context
public function init(): void
{
$this->set('cwd_directory', getcwd());
$this->set('php', PHP_BINARY);
$this->set('cwd_directory', getcwd());
$this->set('phpdocumentor', $this->get('cwd_directory') . '/phpDocumentor.phar');
$this->set('phpdocumentor_template_xml', dirname(__DIR__) . '/placeholders/phpdoc.xml');
$this->set('templates_directory', dirname(__DIR__) . '/templates');
$this->set('phpdocumentor_config_directory', dirname(__DIR__) . '/phpdoc');
$this->set('var_directory', $this->get('cwd_directory') . '/var');
$this->set('config_directory', $this->get('var_directory') . '/config');
$this->set('cache_base_directory', $this->get('var_directory') . '/cache');

13
src/Stage/PhpDocumentorConfigStage.php

@ -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);

0
placeholders/index.html → templates/index.html

0
placeholders/phpdoc.xml → templates/phpdoc.xml

Loading…
Cancel
Save