derick          Fri Feb 15 12:47:21 2008 UTC

  Added files:                 
    /php-src/ext/reflection/tests       reflectionProperty_setAccessible.phpt 

  Removed files:               
    /php-src/ext/reflection/tests       reflectionProperty_setAccesible.phpt 

  Modified files:              
    /php-src/ext/reflection     php_reflection.c 
  Log:
  - Fixed typo
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.293&r2=1.294&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.293 
php-src/ext/reflection/php_reflection.c:1.294
--- php-src/ext/reflection/php_reflection.c:1.293       Fri Feb 15 12:37:37 2008
+++ php-src/ext/reflection/php_reflection.c     Fri Feb 15 12:47:21 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.293 2008/02/15 12:37:37 derick Exp $ */
+/* $Id: php_reflection.c,v 1.294 2008/02/15 12:47:21 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4229,9 +4229,9 @@
 }
 /* }}} */
 
-/* {{{ proto public int ReflectionProperty::setAccesible() U
+/* {{{ proto public int ReflectionProperty::setAccessible() U
    Sets whether non-public properties can be requested */
-ZEND_METHOD(reflection_property, setAccesible)
+ZEND_METHOD(reflection_property, setAccessible)
 {
        reflection_object *intern;
        property_reference *ref;
@@ -4859,7 +4859,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()
 
@@ -4880,7 +4880,7 @@
        ZEND_ME(reflection_property, getDefaultValue, 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}
 };
 
@@ -5059,7 +5059,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.293 
2008/02/15 12:37:37 derick Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.294 
2008/02/15 12:47:21 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

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

Reply via email to