【问题标题】:Custom Template in phpDocumentor ( Failed to create "phar:.......)phpDocumentor 中的自定义模板(无法创建“phar:.......)
【发布时间】:2016-12-22 14:56:08
【问题描述】:

我在一年前为 phpDocumentor 制作了一个自定义模板(扩展自 responsiv-twig)。

现在有了新版本的 phpDocumentor,我无法使用它。

我还尝试将干净的 (responsive-twig) 模板从 phpDocumentor.phar 复制到目录。在这两种情况下,我都会出现以下错误消息:

Preparing template "/Users/rov/Documents/phpStorm/phpDocNewTemplat .. 


  [Symfony\Component\Filesystem\Exception\IOException]                                                                                                                                                    
  Failed to create "phar:///Users/rov/Documents/phpStorm/IA_Local_Development_Instance_Symfony_3/docs/phpDoc/phpDocumentor.phar/src/phpDocumentor/Transformer/../../../data/templates/phpDocNewTemplate"  

如果我尝试使用 gulp 生成文档,也会出现同样的问题。

我试过了:

  • chmod -R 777 on my own template folder(没有改变)

  • chmod -R 777 on my phpDocumentor folder(没有改变)

  • 使用原始模板:--template=responsive-twig(有效)

  • 用谷歌搜索问题(没有发现任何有用的信息)

这是我的终端命令:

php docs/phpDoc/phpDocumentor.phar -d ./src -t ./docs/phpDoc --template="/Users/rov/Documents/phpStorm/phpDocNewTemplate" --title=MyTitle

【问题讨论】:

    标签: templates symfony phpdoc


    【解决方案1】:

    看起来 phpDocumentor 是为 Symfony2 项目设计的: https://packagist.org/packages/phpdocumentor/phpdocumentor

    我在我的主机上试过了,它不适用于 Symfony3 和 PHP7。

    我建议使用 Sami: https://github.com/FriendsOfPHP/Sami

    我试过了,看起来很简单。它也有主题,这在 Symfony3 中得到支持,因为 Symfony3 使用它来生成自己的文档。

    【讨论】:

    • 如果没有自定义模板 phpDoc 可以在 symfony (php 5.5.36) 上正常工作,我会看@Sami。如果 phpDoc 可以工作,那就太好了,因为其他项目不是 symfony 项目,我希望为所有人提供一个文档 :)
    【解决方案2】:

    这个bug只是phpDocumentor phar。

    有了这个版本,我没有问题。我可以创建自己的模板,并且运行良好。

    phpDocumentor-2.9.0.tgz

    【讨论】:

      猜你喜欢
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-27
      • 2014-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多