©
This document uses PHP Chinese website manual Release
(PHP 5)
ReflectionExtension 报告了一个扩展(extension)的有关信息。
$name
)$name
[, string $return
= false
] )扩展的名称,和 ReflectionExtension::getName() 方法所返回的一样。
[#1] Lubaev.K [2013-06-20 15:01:51]
<?php
// The demonstration for the class "ReflectionExtension".
function REData(ReflectionExtension $re, $return=false) {
defined('UNDEFINED') || define('UNDEFINED','%undefined%');
$_data = [];
$_data['getName:'] = $re->getName() ?: UNDEFINED;
$_data['getVersion:'] = $re->getVersion() ?: UNDEFINED;
$_data['info:'] = $re->info() ?: UNDEFINED;
$_data['getClassName:'] = PHP_EOL.implode(", ",$re->getClassNames()) ?: UNDEFINED;
foreach ($re->getConstants() as $key => $value) $_data['getConstants:'] .= "\n{$key}:={$value}";
$_data['getDependencies:'] = $re->getDependencies() ?: UNDEFINED;
$_data['getFunctions:'] = PHP_EOL.implode(", ",array_keys($re->getFunctions())) ?: UNDEFINED;
$_data['getINIEntries:'] = $re->getINIEntries() ?: UNDEFINED;
$_data['isPersistent:'] = $re->isPersistent() ?: UNDEFINED;
$_data['isTemporary:'] = $re->isTemporary() ?: UNDEFINED;
return print_r($_data, $return);
}
REData( new ReflectionExtension( 'Reflection' ) );
REData( new ReflectionExtension( 'zlib' ) );
// Reflection
// Reflection => enabled
// Version => $Id: 60f1e547a6dd00239162151e701566debdcee660 $
// zlib
// ZLib Support => enabled
// Stream Wrapper => compress.zlib://
// Stream Filter => zlib.inflate, zlib.deflate
// Compiled Version => 1.2.7
// Linked Version => 1.2.7
// Directive => Local Value => Master Value
// zlib.output_compression => Off => Off
// zlib.output_compression_level => -1 => -1
// zlib.output_handler => no value => no value