Browse Source

Add dedicated reflection_exception

PEAR_1_4DEV
Marcus Boerger 23 years ago
parent
commit
e44d0f526c
  1. 24
      Zend/zend_reflection_api.c
  2. 24
      ext/reflection/php_reflection.c

24
Zend/zend_reflection_api.c

@ -26,6 +26,16 @@
#include "zend_constants.h"
#include "zend_ini.h"
/* Class entry pointers */
zend_class_entry *reflector_ptr;
zend_class_entry *reflection_exception_ptr;
zend_class_entry *reflection_ptr;
zend_class_entry *reflection_function_ptr;
zend_class_entry *reflection_class_ptr;
zend_class_entry *reflection_method_ptr;
zend_class_entry *reflection_property_ptr;
zend_class_entry *reflection_extension_ptr;
/* Method macros */
#define METHOD_NOTSTATIC \
if (!this_ptr) { \
@ -47,7 +57,7 @@
/* Exception throwing macro */
#define _DO_THROW(msg) \
zend_throw_exception(msg, 0 TSRMLS_CC); \
zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC); \
return; \
/* Smart string macros */
@ -111,15 +121,6 @@ typedef struct {
unsigned int free_ptr:1;
} reflection_object;
/* Class entry pointers */
zend_class_entry *reflector_ptr;
zend_class_entry *reflection_ptr;
zend_class_entry *reflection_function_ptr;
zend_class_entry *reflection_class_ptr;
zend_class_entry *reflection_method_ptr;
zend_class_entry *reflection_property_ptr;
zend_class_entry *reflection_extension_ptr;
static zend_object_handlers reflection_object_handlers;
static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC)
@ -2240,6 +2241,9 @@ ZEND_API void zend_register_reflection_api(TSRMLS_D) {
memcpy(&reflection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
INIT_CLASS_ENTRY(_reflection_entry, "reflection_exception", reflection_functions);
reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(), NULL TSRMLS_CC);
INIT_CLASS_ENTRY(_reflection_entry, "reflection", reflection_functions);
reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);

24
ext/reflection/php_reflection.c

@ -26,6 +26,16 @@
#include "zend_constants.h"
#include "zend_ini.h"
/* Class entry pointers */
zend_class_entry *reflector_ptr;
zend_class_entry *reflection_exception_ptr;
zend_class_entry *reflection_ptr;
zend_class_entry *reflection_function_ptr;
zend_class_entry *reflection_class_ptr;
zend_class_entry *reflection_method_ptr;
zend_class_entry *reflection_property_ptr;
zend_class_entry *reflection_extension_ptr;
/* Method macros */
#define METHOD_NOTSTATIC \
if (!this_ptr) { \
@ -47,7 +57,7 @@
/* Exception throwing macro */
#define _DO_THROW(msg) \
zend_throw_exception(msg, 0 TSRMLS_CC); \
zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC); \
return; \
/* Smart string macros */
@ -111,15 +121,6 @@ typedef struct {
unsigned int free_ptr:1;
} reflection_object;
/* Class entry pointers */
zend_class_entry *reflector_ptr;
zend_class_entry *reflection_ptr;
zend_class_entry *reflection_function_ptr;
zend_class_entry *reflection_class_ptr;
zend_class_entry *reflection_method_ptr;
zend_class_entry *reflection_property_ptr;
zend_class_entry *reflection_extension_ptr;
static zend_object_handlers reflection_object_handlers;
static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC)
@ -2240,6 +2241,9 @@ ZEND_API void zend_register_reflection_api(TSRMLS_D) {
memcpy(&reflection_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
INIT_CLASS_ENTRY(_reflection_entry, "reflection_exception", reflection_functions);
reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(), NULL TSRMLS_CC);
INIT_CLASS_ENTRY(_reflection_entry, "reflection", reflection_functions);
reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);

Loading…
Cancel
Save