我们在用PHPinfo函数或命令行的php -i命令查看php环境相关的信息,当我们开发完成一个自己的扩展,除非这个扩展就是你自己所使用,否则你就需要对扩展进行相关的介绍,或者显示扩展用到的ini配置,这个时候你就可以使用MINFO的函数,把你想展示的信息通过它来等记,最后在phpinfo或php-i中别人可以看到这些信息。

PHP_MINFO_FUNCTION(myext);//php_myext.h

//你想展示的扩展信息
PHP_MINFO_FUNCTION(myext){
  //这里面的内容其实就printf输出,只是php内核提供了一些封装好的函数,方便我们输出
php_info_print_table_start();
php_info_print_table_row(, "version", PHP_MYEXT_VERSION);
php_info_print_table_row(, "writer", "zhangxiaomin");
php_info_print_table_end();
} zend_module_entry myext_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"myext",//扩展名称
myext_functions,//zend_function_entry myext_functions 定义好的函数扩展变量
PHP_MINIT(myext),//MINIT_FUNCTION
NULL,//MSHUTDOWN_FUNCTION
NULL,//RINIT_FUNCTION
NULL,//RSHUTDOWN_FUNCTION
PHP_MINFO(myext),//MINFO_FUNCTION,在这里注册PHP_MINFO_FUNCTION
#if ZEND_MODULE_API_NO >= 20010901
PHP_MYEXT_VERSION,
#endif
STANDARD_MODULE_PROPERTIES
};
//ext/standard/info.h
//这些函数已经对cli或HTML的环境做了处理,会分别显示对应的文本内容 PHPAPI char *php_info_html_esc(char *string TSRMLS_DC);
PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC);
PHPAPI void php_print_info_htmlhead(TSRMLS_D);
PHPAPI void php_print_info(int flag TSRMLS_DC);
PHPAPI void php_print_style(void);
PHPAPI void php_info_print_style(TSRMLS_D);
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header);
PHPAPI void php_info_print_table_header(int num_cols, ...);
PHPAPI void php_info_print_table_row(int num_cols, ...);
PHPAPI void php_info_print_table_row_ex(int num_cols, const char *, ...);
PHPAPI void php_info_print_table_start(void);
PHPAPI void php_info_print_table_end(void);
PHPAPI void php_info_print_box_start(int bg);
PHPAPI void php_info_print_box_end(void);
PHPAPI void php_info_print_hr(void);
PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC);

最新文章

  1. 为什么 MySQL 回滚事务也会导致 ibd 文件增大?
  2. list 集合
  3. linux chmod 命令
  4. 十八、Java基础--------IO流体系以及字符流
  5. CodeIgniter框架中关于URL(index.php)的那些事
  6. 解密SQL SERVER 2005加密存储过程,函数
  7. vi使用教程
  8. S5PV210启动过程分析
  9. HTML5简单入门系列(四)
  10. lda模型的python实现
  11. cocostudio——js 3 final控件事件
  12. C#嵌套类
  13. 深度学习梯度反向传播出现Nan值的原因归类
  14. js静态方法与实例方法定义,js回调方法定义
  15. 内核中的锁机制--RCU
  16. java学习笔记37(sql工具类:JDBCUtils)
  17. WordCount 程序的实现
  18. tpshop防止sql注入补丁
  19. 【CS231N】4、神经网络
  20. 【LeetCode】153. Find Minimum in Rotated Sorted Array (3 solutions)

热门文章

  1. MVC数据库问题(更新,添加字段)
  2. SpringBoot系列之——整合JPA、mysql
  3. jdk安装完为什么会有两个JRE?
  4. Sharepoint2010新建一个用户的方法
  5. Python基本操作之文件操作
  6. jQuery设置全选和全反选
  7. c语言函数指针的几种使用方式
  8. Static 用法
  9. ssh-agent && ssh-agent forward && SSH ProxyCommand
  10. jquery对checkbox的操作汇总