在 symfony2 上使用 phpDocumentor [英] use phpDocumentor on symfony2

查看:33
本文介绍了在 symfony2 上使用 phpDocumentor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了一个新的 symfony 2.4 项目,并按照以下步骤使用 composer.phar 安装了 phpDocumentor:

I installed a new symfony 2.4 project and I installed also phpDocumentor using composer.phar folowing these steps:

1- 添加:需要开发":{"phpdocumentor/phpdocumentor": "2.*"到我的 composer.json

1- Adding: "require-dev": { "phpdocumentor/phpdocumentor": "2.*" } to My composer.json

2- 执行:php composer.phar 更新

2- Executing : php composer.phar update

安装终止后,我可以在/vendor 中看到 phpdocumentor 文件夹,所以我猜安装已成功终止.

After installation terminated I can see phpdocumentor Folder in /vendor so I guess installation is terminated with success.

现在我想知道如何在 symfony 上使用 phpDocumentor(为我的代码源生成文档).

Now I want to know how to use phpDocumentor on symfony (generate a documentation for my code source).

我在 Ubuntu 网络服务器上工作.

I work on Ubuntu web server.

谢谢你,抱歉我的英语不好.

Thank you and sorry for my bad english.

推荐答案

STEP 1.phpdocumentor/phpdocumentor 的依赖添加到 require-dev<项目的 composer.json 配置文件的/code> 部分,并更新您的应用程序.

STEP 1. Add a dependency to phpdocumentor/phpdocumentor to the require-dev section of your project's composer.json configuration file, and update your application.

{
    "require-dev": {
        "phpdocumentor/phpdocumentor": "2.*"
    }
}

步骤 2. 在项目中运行 composer update 命令

STEP 2. Run composer update command inside your project

STEP 3.CMD 进入你项目的 vendor\phpdocumentor\phpdocumentor\bin 目录,然后运行以下命令生成文档AppBundle/Controller 文件夹代码.这将在 \phpdocumentor\phpdocumentor\bin\doc 目的地生成 AppBundle/Controller 文件夹的文档.

STEP 3. Go to vendor\phpdocumentor\phpdocumentor\bin directory of your project from CMD and then run following command to generate document of AppBundle/Controller folder code. This will generate document of your AppBundle/Controller folder at \phpdocumentor\phpdocumentor\bin\doc destination.

命令:- php phpdoc run -d ../../../../src/AppBundle/Controller/-t doc/

这篇关于在 symfony2 上使用 phpDocumentor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆