首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >警告: PHPLoc浓缩未启用或phploc.xml未在phpDox中找到

警告: PHPLoc浓缩未启用或phploc.xml未在phpDox中找到
EN

Stack Overflow用户
提问于 2016-06-28 16:36:56
回答 1查看 2.4K关注 0票数 2

我在项目构建上使用Jenkins和Ant为我的PHP项目生成API文档:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<project name="MyProject" default="full-build">
    <property name="pdepend" value="/usr/share/.composer/vendor/bin/pdepend" />
    ...
    <target name="full-build" depends="prepare,static-analysis,phpdox" />
    <target name="prepare" unless="prepare.done" depends="clean">
        <mkdir dir="${basedir}/build/api" />
        ...
    </target>
    <target name="clean" unless="clean.done">
        <delete dir="${basedir}/build/api" />
        ...
    </target>
    <target name="static-analysis">
        <parallel threadCount="2">
            <sequential>
                <antcall target="pdepend" />
                <antcall target="phpmd" />
            </sequential>
            <antcall target="lint" />
            <antcall target="phpcpd" />
            <antcall target="phpcs" />
            <antcall target="phploc" />
        </parallel>
    </target>
    <target name="pdepend" unless="pdepend.done" depends="prepare">
        ...
    </target>
    <target name="phpmd" unless="phpmd.done">
        ...
    </target>
    <target name="lint" unless="lint.done">
        ...
    </target>
    <target name="phpcpd" unless="phpcpd.done">
        ...
    </target>
    <target name="phpcs" unless="phpcs.done">
        ...
    </target>
    <target name="phpdox" depends="phploc,phpcs,phpmd" unless="phpdox.done">
        <exec executable="${phpdox}" dir="${basedir}/build" taskname="phpdox">
            <arg value="--file" />
            <arg value="${basedir}/build/phpdox.xml" />
        </exec>
        <property name="phpdox.done" value="true" />
    </target>
    <target name="phploc" unless="phploc.done">
        ...
    </target>
</project>

当构建完成并打开API文档的index.xhtml时,将显示一个警告:

警告:未启用PHPLoc浓缩或未找到phploc.xml。

为什么会显示此警告,以及如何解决它引起的问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-06 17:35:25

phpDox需要生成一个phploc.xml文件。您的目标phploc是否生成这样的文件(param:--log-xml <filename>)?

示例目标phploc

代码语言:javascript
复制
<target name="phploc" unless="phploc.done">
    <exec executable="${phploc}" taskname="phploc">
        <arg value="--count-tests" />
        <arg value="--log-csv" />
        <arg path="${basedir}/build/logs/phploc.csv" />
        <arg value="--log-xml" />
        <arg path="${basedir}/build/logs/phploc.xml" />
        <arg path="....." />
    </exec>
    <property name="phploc.done" value="true"/>
</target>

如果未找到或启动PHPLOC丰富器,则应从phpDox Ant构建脚本反馈中省略以下行:

代码语言:javascript
复制
[phpdox] [06.07.2016 - 16:37:58] Registered enricher 'phploc'
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38081749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档