cvs: php-src(PHP_5_3) / NEWS /ext/reflection php_reflection.c /ext/reflection/tests reflectionProperty_setAccesible.phpt
reflectionProperty_setAccessible.phpt

From: Date: Fri, 15 Feb 2008 12:48:13 +0000
Subject: cvs: php-src(PHP_5_3) / NEWS /ext/reflection php_reflection.c /ext/reflection/tests reflectionProperty_setAccesible.phpt
reflectionProperty_setAccessible.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-48565@lists.php.net to get a copy of this message
derick Fri Feb 15 12:48:13 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/reflection/tests reflectionProperty_setAccessible.phpt Removed files: /php-src/ext/reflection/tests reflectionProperty_setAccesible.phpt Modified files: /php-src NEWS /php-src/ext/reflection php_reflection.c Log: - Fixed speling. http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.112&r2=1.2027.2.547.2.965.2.113&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.112 php-src/NEWS:1.2027.2.547.2.965.2.113 --- php-src/NEWS:1.2027.2.547.2.965.2.112 Fri Feb 15 12:38:52 2008 +++ php-src/NEWS Fri Feb 15 12:48:13 2008 @@ -40,7 +40,7 @@ . Added SplDoublyLinkedList, SplStack, SplQueue classes. (Etienne) . Added FilesystemIterator. (Marcus) . Added GlobIterator. (Marcus) -- Add the ReflectionProperty::setAccesible() method that allows non-public +- Add the ReflectionProperty::setAccessible() method that allows non-public property's values to be read through ::getValue(). - Added ability to use Traversable objects instead of plain arrays in ext/soap. (Joshua Reese, Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.12&r2=1.164.2.33.2.45.2.13&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.12 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.13 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.12 Fri Feb 15 12:38:53 2008 +++ php-src/ext/reflection/php_reflection.c Fri Feb 15 12:48:13 2008 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.12 2008/02/15 12:38:53 derick Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.13 2008/02/15 12:48:13 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -4119,9 +4119,9 @@ } /* }}} */ -/* {{{ proto public int ReflectionProperty::setAccesible() +/* {{{ proto public int ReflectionProperty::setAccessible() Sets whether non-public properties can be requested */ -ZEND_METHOD(reflection_property, setAccesible) +ZEND_METHOD(reflection_property, setAccessible) { reflection_object *intern; property_reference *ref; @@ -4744,7 +4744,7 @@ ZEND_END_ARG_INFO() static -ZEND_BEGIN_ARG_INFO(arginfo_reflection_property_setAccesible, 0) +ZEND_BEGIN_ARG_INFO(arginfo_reflection_property_setAccessible, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -4764,7 +4764,7 @@ ZEND_ME(reflection_property, getModifiers, NULL, 0) ZEND_ME(reflection_property, getDeclaringClass, NULL, 0) ZEND_ME(reflection_property, getDocComment, NULL, 0) - ZEND_ME(reflection_property, setAccesible, arginfo_reflection_property_setAccesible, 0) + ZEND_ME(reflection_property, setAccessible, arginfo_reflection_property_setAccessible, 0) {NULL, NULL, NULL} }; @@ -4943,7 +4943,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.164.2.33.2.45.2.12 2008/02/15 12:38:53 derick Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.45.2.13 2008/02/15 12:48:13 derick Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionProperty_setAccessible.phpt?view=markup&rev=1.1 Index: php-src/ext/reflection/tests/reflectionProperty_setAccessible.phpt +++ php-src/ext/reflection/tests/reflectionProperty_setAccessible.phpt --TEST-- Test ReflectionProperty::setAccessible(). --SKIPIF-- <?php extension_loaded('reflection') or die('skip'); ?> --FILE-- <?php class TestClass { public $pub; public $pub2 = 5; static public $stat = "static property"; protected $prot = 4; private $priv = "keepOut"; } class AnotherClass { } $instance = new TestClass(); echo "\nProtected property:\n"; $propInfo = new ReflectionProperty('TestClass', 'prot'); try { var_dump($propInfo->getValue($instance)); } catch(Exception $exc) { echo $exc->getMessage(), "\n"; } $propInfo->setAccessible(true); var_dump($propInfo->getValue($instance)); $propInfo->setAccessible(false); try { var_dump($propInfo->getValue($instance)); } catch(Exception $exc) { echo $exc->getMessage(), "\n"; } ?> --EXPECTF-- Protected property: Cannot access non-public member TestClass::prot int(4) Cannot access non-public member TestClass::prot

« previous php.cvs (#48565) next »