PHP扩展相关信息及类函数如何查看,及内置函数参数怎么看的命令行查看办法备案。

jackxiang 2015-9-11 11:19 | |
背景:有时需要查一些函数,比如分隔函数,不知道那个分割符号是放第几位了,怎么办? 有时想看php.ini文件在哪儿了,怎么办?有时想看这个扩展如:swoole扩展的相关扩展信息怎么看?有时想看这个扩展的类名怎么看?有时想看这个扩展的函数有哪些怎么了解,这些都是问题,于是有该文。


php -i ,php -i|grep php.ini  php --ri swoole  php --ri memcache

零)php -i|grep php.ini
[root@localhost htdocs]# php -i|grep php.ini
Configuration File (php.ini) Path => /usr/local/php/etc
Loaded Configuration File => /usr/local/php/etc/php.ini

  --rf <name>      Show information about function <name>.
  --rc <name>      Show information about class <name>.
  --re <name>      Show information about extension <name>.
  --ri <name>      Show configuration for extension <name>.


一)php --rf explode
[root@localhost htdocs]# php --rf explode
Function [ <internal:standard> function explode ] {

  - Parameters [3] {
    Parameter #0 [ <required> $separator ]
    Parameter #1 [ <required> $str ]
    Parameter #2 [ <optional> $limit ]
  }
}

二)php --ri memcache
memcache
memcache support => enabled
Version => 3.0.6
Revision => $Revision: 310129 $

Directive => Local Value => Master Value
memcache.allow_failover => 1 => 1
memcache.max_failover_attempts => 20 => 20
memcache.default_port => 11211 => 11211
memcache.chunk_size => 32768 => 32768
memcache.protocol => ascii => ascii
memcache.hash_strategy => consistent => consistent
memcache.hash_function => crc32 => crc32
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2
memcache.compress_threshold => 20000 => 20000
memcache.lock_timeout => 15 => 15



三)--re <name>      Show information about extension <name>.
php --re memcache
Extension [ <persistent> extension #39 memcache version 3.0.6 ] {

  Method [ <internal:memcache, inherits MemcachePool> public method decrement ] {
        }

        Method [ <internal:memcache, inherits MemcachePool> public method close ] {
        }

        Method [ <internal:memcache, inherits MemcachePool> public method flush ] {
        }
      }



四)--rc <name>      Show information about class <name>.

php --rc memcache
Class [ <internal:memcache> class Memcache extends MemcachePool ] {

  - Constants [0] {
  }

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/8254/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]