summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-07-24 23:15:58 +0000
committerJohannes Schlüter <johannes@php.net>2007-07-24 23:15:58 +0000
commit179c67a64bb9e5999504061ff66cdb5ce66d1b1d (patch)
treed2517406ce069ff6d0166057f9ab2caf63eb9738 /ext/reflection
parente3b8cf0f66bdb2765c17b633c4d9df4a51e6e025 (diff)
downloadphp-git-179c67a64bb9e5999504061ff66cdb5ce66d1b1d.tar.gz
- New ReflectionExtension::info() function to print the phpinfo() block
for an extension. [DOC]
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/php_reflection.c15
-rw-r--r--ext/reflection/tests/026.phpt36
2 files changed, 51 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index e4f7407b1d..916a0a3188 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4394,6 +4394,20 @@ ZEND_METHOD(reflection_extension, getDependencies)
}
/* }}} */
+/* {{{ proto public void ReflectionExtension::info() U
+ Prints phpinfo block for the extension */
+ZEND_METHOD(reflection_extension, info)
+{
+ reflection_object *intern;
+ zend_module_entry *module;
+
+ METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0);
+ GET_REFLECTION_OBJECT_PTR(module);
+
+ php_info_print_module(module TSRMLS_CC);
+}
+/* }}} */
+
/* {{{ method tables */
static zend_function_entry reflection_exception_functions[] = {
{NULL, NULL, NULL}
@@ -4770,6 +4784,7 @@ static zend_function_entry reflection_extension_functions[] = {
ZEND_ME(reflection_extension, getClasses, NULL, 0)
ZEND_ME(reflection_extension, getClassNames, NULL, 0)
ZEND_ME(reflection_extension, getDependencies, NULL, 0)
+ ZEND_ME(reflection_extension, info, NULL, 0)
{NULL, NULL, NULL}
};
/* }}} */
diff --git a/ext/reflection/tests/026.phpt b/ext/reflection/tests/026.phpt
new file mode 100644
index 0000000000..e4c6a3f864
--- /dev/null
+++ b/ext/reflection/tests/026.phpt
@@ -0,0 +1,36 @@
+--TEST--
+reflectionExtension::info()
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+$r = new ReflectionExtension("reflection");
+$r->info();
+
+date_default_timezone_set('Europe/Berlin');
+$r = new ReflectionExtension("date");
+$r->info();
+
+echo "\nDone!\n";
+
+--EXPECTF--
+Reflection
+
+Reflection => enabled
+Version => %s
+
+date
+
+date/time support => enabled
+"Olson" Timezone Database Version => %s
+Timezone Database => %s
+Default timezone => %s
+
+Directive => %s => %s
+date.timezone => %s => %s
+date.default_latitude => %s => %s
+date.default_longitude => %s => %s
+date.sunset_zenith => %s => %s
+date.sunrise_zenith => %s => %s
+
+Done!