解决 PHPdoc 给出的错误消息

发布于 2024-08-03 06:50:35 字数 2536 浏览 1 评论 0原文

如何解决 PHPdoc 给出的以下错误消息?

我通过以下命令运行 madedoc.sh

Command

sudo ./makedoc.sh

我收到

错误消息

PHP Version 5.2.6-3ubuntu4.2
phpDocumentor version 1.4.2

Parsing configuration file phpDocumentor.ini...
   (found in /usr/share/php/data/PhpDocumentor/)...

done
Maximum memory usage set at 256M after considering php.ini...
using tokenizer Parser

        ERROR: Converter PDFSmartyConverter specified by --output command-line option is not a class

        ERROR: No Converters have been specified by --output command-line option

        ERROR: No Converters have been specified by --output command-line option

我试图生成的注释示例

/** Create HTML for tags
 * @param string @tags
 */
function create_tags_at_question ( $tags ) {
    echo ("<label for='tags'>Tags</label>"
        . "<input name='question[tags]' type='text' cols='92' class='tags' id='required'"
        . " value='" . $tags . "' />"
    );
}

我的 PHPdoc 的 makedoc.sh

#!/bin/bash
#/**
#  * title of generated documentation, default is 'Generated Documentation'
#  *
#  * @var               string TITLE
#  */
TITLE="komponentit"

#/**
#  * name to use for the default package. If not specified, uses 'default'
#  *
#  * @var               string PACKAGES
#  */
PACKAGES="default"

#/**
#  * name of a directory(s) to parse directory1,directory2
#  * $PWD is the directory where makedoc.sh
#  *
#  * @var               string PATH_PROJECT
#  */
PATH_PROJECT=$PWD:$PWD/handlers/:$PWD/handlers/searches/

#/**
#  * path of PHPDoc executable
#  *
#  * @var               string PATH_PHPDOC
#  */
PATH_PHPDOC=/usr/bin/phpdoc

#/**
#  * where documentation will be put
#  *
#  * @var               string PATH_DOCS
#  */
PATH_DOCS=$PWD/docs/

#/**
#  * what outputformat to use (html/pdf)
#  *
#  * @var               string OUTPUTFORMAT
#  */
OUTPUTFORMAT=pdf

#/**
#  * converter to be used
#  *
#  * @var               string CONVERTER
#  */
CONVERTER=Smarty

#/**
#  * template to use
#  *
#  * @var               string TEMPLATE
#  */
TEMPLATE=default

#/**
#  * parse elements marked as private
#  *
#  * @var               bool (on/off)           PRIVATE
#  */
PRIVATE=off

# make documentation
"$PATH_PHPDOC" -d "$PATH_PROJECT" -t "$PATH_DOCS" -ti "$TITLE" -dn $PACKAGES \
-o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE

How can you solve the following error messages given by PHPdoc?

I run madedoc.sh by the following command

Command

sudo ./makedoc.sh

I get

Error messages

PHP Version 5.2.6-3ubuntu4.2
phpDocumentor version 1.4.2

Parsing configuration file phpDocumentor.ini...
   (found in /usr/share/php/data/PhpDocumentor/)...

done
Maximum memory usage set at 256M after considering php.ini...
using tokenizer Parser

        ERROR: Converter PDFSmartyConverter specified by --output command-line option is not a class

        ERROR: No Converters have been specified by --output command-line option

        ERROR: No Converters have been specified by --output command-line option

Example of comments what I am trying to generate

/** Create HTML for tags
 * @param string @tags
 */
function create_tags_at_question ( $tags ) {
    echo ("<label for='tags'>Tags</label>"
        . "<input name='question[tags]' type='text' cols='92' class='tags' id='required'"
        . " value='" . $tags . "' />"
    );
}

My makedoc.sh for PHPdoc

#!/bin/bash
#/**
#  * title of generated documentation, default is 'Generated Documentation'
#  *
#  * @var               string TITLE
#  */
TITLE="komponentit"

#/**
#  * name to use for the default package. If not specified, uses 'default'
#  *
#  * @var               string PACKAGES
#  */
PACKAGES="default"

#/**
#  * name of a directory(s) to parse directory1,directory2
#  * $PWD is the directory where makedoc.sh
#  *
#  * @var               string PATH_PROJECT
#  */
PATH_PROJECT=$PWD:$PWD/handlers/:$PWD/handlers/searches/

#/**
#  * path of PHPDoc executable
#  *
#  * @var               string PATH_PHPDOC
#  */
PATH_PHPDOC=/usr/bin/phpdoc

#/**
#  * where documentation will be put
#  *
#  * @var               string PATH_DOCS
#  */
PATH_DOCS=$PWD/docs/

#/**
#  * what outputformat to use (html/pdf)
#  *
#  * @var               string OUTPUTFORMAT
#  */
OUTPUTFORMAT=pdf

#/**
#  * converter to be used
#  *
#  * @var               string CONVERTER
#  */
CONVERTER=Smarty

#/**
#  * template to use
#  *
#  * @var               string TEMPLATE
#  */
TEMPLATE=default

#/**
#  * parse elements marked as private
#  *
#  * @var               bool (on/off)           PRIVATE
#  */
PRIVATE=off

# make documentation
"$PATH_PHPDOC" -d "$PATH_PROJECT" -t "$PATH_DOCS" -ti "$TITLE" -dn $PACKAGES \
-o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

策马西风 2024-08-10 06:50:35

请耐心听我说……我不知道 PHPdoc,所以我在这里猜测一下,直到骑兵到达。

有些事情

"$PATH_PHPDOC" -d "$PATH_PROJECT" -t "$PATH_DOCS" -ti "$TITLE" -dn $PACKAGES \
-o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE

让分词器解析器不高兴。语法中有些东西不正确。

所有三个错误都与 makedoc.sh 的这一行相关

  • -output 可能是您在 makedoc.sh 中使用的 -o 的长形式
  • PdfSmartConverter 在第一个错误中似乎是由 makedoc.sh 中的几个变量一起运行组成的。您需要空格或其他分隔符吗?
  • 你需要更多“”
  • 是“pdf”足够的输出格式说明符

正如我所说,我只是猜测 - 但也许它会给你一些想法。

现在……那支骑兵在哪里?

Bear with me ... I don't know PHPdoc, so I'm guessing a little here, until the cavalry arrives.

Something about

"$PATH_PHPDOC" -d "$PATH_PROJECT" -t "$PATH_DOCS" -ti "$TITLE" -dn $PACKAGES \
-o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE

makes tokenizer Parser unhappy. Something in the syntax is not right.

All three errors relate to this line of makedoc.sh

  • --output is probably the long form of the -o you used in makedoc.sh
  • PdfSmartConverter in the first error seems to be made of several of the variables in makedoc.sh run together. Do you need spaces or some other delimiter?
  • do you need more ""
  • is 'pdf' enough of an outputformat specifier

As I said, I'm just guessing - but maybe it'll give you some ideas.

Now ... where is that cavalry?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文