PHP 5.4.31 Released

The ReflectionExtension class

(PHP 5)

Introducere

The ReflectionExtension class reports information about an extension.

Sinopsisul clasei

ReflectionExtension implements Reflector {
/* Proprietăți */
public $name ;
/* Metode */
final private void __clone ( void )
public __construct ( string $name )
public static string export ( string $name [, string $return = false ] )
public array getClasses ( void )
public array getClassNames ( void )
public array getConstants ( void )
public array getDependencies ( void )
public array getFunctions ( void )
public array getINIEntries ( void )
public string getName ( void )
public string getVersion ( void )
public void info ( void )
public void isPersistent ( void )
public void isTemporary ( void )
public string __toString ( void )
}

Proprietăți

name

Name of the extension, same as calling the ReflectionExtension::getName() method.

Cuprins

add a note add a note

User Contributed Notes 1 note

up
1
Lubaev.K
1 year ago
<?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 $
/*
Array
(
    [getName:] => Reflection
    [getVersion:] => $Id: 60f1e547a6dd00239162151e701566debdcee660 $
    [info:] => %undefined%
    [getClassName:] =>
ReflectionException, Reflection, Reflector, ReflectionFunctionAbstract, Reflecti
onFunction, ReflectionParameter, ReflectionMethod, ReflectionClass, ReflectionOb
ject, ReflectionProperty, ReflectionExtension, ReflectionZendExtension
    [getDependencies:] => %undefined%
    [getFunctions:] =>

    [getINIEntries:] => %undefined%
    [isPersistent:] => 1
    [isTemporary:] => %undefined%
)
*/
// 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
/*
Array
(
    [getName:] => zlib
    [getVersion:] => 2.0
    [info:] => %undefined%
    [getClassName:] =>

    [getConstants:] =>
FORCE_GZIP:=31
FORCE_DEFLATE:=15
ZLIB_ENCODING_RAW:=-15
ZLIB_ENCODING_GZIP:=31
ZLIB_ENCODING_DEFLATE:=15
    [getDependencies:] => %undefined%
    [getFunctions:] =>
readgzfile, gzrewind, gzclose, gzeof, gzgetc, gzgets, gzgetss, gzread, gzopen, g
zpassthru, gzseek, gztell, gzwrite, gzputs, gzfile, gzcompress, gzuncompress, gz
deflate, gzinflate, gzencode, gzdecode, zlib_encode, zlib_decode, zlib_get_codin
g_type, ob_gzhandler
    [getINIEntries:] => Array
        (
            [zlib.output_compression] =>
            [zlib.output_compression_level] => -1
            [zlib.output_handler] =>
        )

    [isPersistent:] => 1
    [isTemporary:] => %undefined%
)
*/
To Top