johannes                Tue Jul 24 23:16:47 2007 UTC

  Modified files:              
    /php-src/ext/reflection     php_reflection.c 
    /php-src/ext/reflection/tests       026.phpt 
  Log:
  - MFB: New ReflectionExtension::info() function to print the phpinfo() block
    for an extension.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.279&r2=1.280&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.279 
php-src/ext/reflection/php_reflection.c:1.280
--- php-src/ext/reflection/php_reflection.c:1.279       Mon Jul 23 01:21:04 2007
+++ php-src/ext/reflection/php_reflection.c     Tue Jul 24 23:16:47 2007
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.279 2007/07/23 01:21:04 bjori Exp $ */
+/* $Id: php_reflection.c,v 1.280 2007/07/24 23:16:47 johannes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4512,6 +4512,20 @@
 }
 /* }}} */
 
+/* {{{ 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}
@@ -4889,6 +4903,7 @@
        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}
 };
 /* }}} */
@@ -5007,7 +5022,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.279 
2007/07/23 01:21:04 bjori Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.280 
2007/07/24 23:16:47 johannes Exp $");
 
        php_info_print_table_end();
 } /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/026.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/reflection/tests/026.phpt
diff -u /dev/null php-src/ext/reflection/tests/026.phpt:1.2
--- /dev/null   Tue Jul 24 23:16:47 2007
+++ php-src/ext/reflection/tests/026.phpt       Tue Jul 24 23:16:47 2007
@@ -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!

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to