GithubHelp home page GithubHelp logo

guoyu07 / php-document-creator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shixinke/php-document-creator

0.0 0.0 0.0 351 KB

a document creator for php extension.一个用于生成PHP扩展文档的工具

Home Page: http://www.shixinke.com

PHP 100.00%

php-document-creator's Introduction

phpDocumentCreator

===============

english document

phpDocumentCreator是一个用于生成PHP扩展文档的类库.因为PHP的扩展是使用C语言编写的,所以我们没办法直接查看扩展函数或扩展类库的用法,只能通过查看C源码来了解。我们通过PHP的反射类库列出某个PHP扩展的常量、函数、类常量、属性和方法,然而有时反射类库不能显示完整的信息,而且这些类库没有注释,所以为了弥补这个缺陷,我们可以通过自定义的数据字典为这些扩展类库添加注释,或者我们通过已有PHP代码为这些扩展类库添加注释

安装

1、 通过从github上clone代码

git clone https://github.com/shixinke/php-document-creator

2、 通过composer安装

  composer require shixinke/php-document-creator

基本用法

我们可以通过测试代码查看其用法.(如tests/docTest.php)

创建字典

require_once '../Autoloader.php';
//Redis为扩展的名称
$doc = new \documentCreator\Document('Redis');
$doc->createDict();

cd tests
php docTest.php

生成PHP文档

require_once '../Autoloader.php';
//Redis为扩展的名称
$doc = new \documentCreator\Document('Redis');
$doc->create();

cd tests
php docTest.php

通过PHP源码生成文档

require_once '../Autoloader.php';
//Redis为扩展的名称
$doc = new \documentCreator\Document('Redis');
//./notes/redis.php为带注释的源码文件
$transform = new \documentCreator\Transform('./notes/redis.php');
//通过注释的文件更新字典文件
$doc->updateDict('redis', $transform->info());
//生成输出文档
$doc->create();

cd tests
php transformTest.php

其他说明

字典

包含PHP扩展的函数、常量和类常量、属性和方法的说明(主要是类型说明,参数说明和注释)

这里自带了yaf,swoole,redis这三个扩展的字典

备注(PHP源代码)

带有注释的PHP源码,目前这里列举了yaf,swoole,redis等三个扩展的注释文件

输出(最终的PHP文档)

如果想使用已经生成好的文档,请查看phpstrom框架助手

如果有好的注释文件请push给我

Author

author:shixinke([email protected],[email protected])

website:http://www.shixinke.com

php-document-creator's People

Contributors

shixinke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.