From 149f57565a44d06fde8cb69de317bbd8408c0392 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 9 Sep 2012 15:48:31 +0800 Subject: [PATCH] enable namespace mode in 5.3+ --- configs/ini.c | 5 +++-- configs/simple.c | 5 +++-- php_yaf.h | 5 +---- requests/http.c | 5 +++-- requests/simple.c | 6 ++++-- response/cli.c | 7 +++---- response/http.c | 6 +++--- routes/interface.c | 6 ++++-- routes/map.c | 5 +++-- routes/regex.c | 6 ++++-- routes/rewrite.c | 6 ++++-- routes/simple.c | 5 +++-- routes/static.c | 5 +++-- routes/supervar.c | 6 ++++-- views/interface.c | 5 +++-- views/simple.c | 5 +++-- yaf.c | 5 +---- yaf_action.c | 6 ++++-- yaf_application.c | 7 ++++--- yaf_bootstrap.c | 5 +++-- yaf_config.c | 5 +++-- yaf_controller.c | 6 ++++-- yaf_dispatcher.c | 6 +++--- yaf_exception.c | 33 ++++++++++++++++++++++----------- yaf_loader.c | 5 +++-- yaf_namespace.h | 19 ++++++------------- yaf_plugin.c | 29 +++++------------------------ yaf_registry.c | 6 +++--- yaf_request.c | 7 ++++--- yaf_response.c | 6 +++--- yaf_router.c | 6 +++--- yaf_session.c | 6 +++--- 32 files changed, 125 insertions(+), 120 deletions(-) diff --git a/configs/ini.c b/configs/ini.c index a260ecc0..2f5a8ca6 100644 --- a/configs/ini.c +++ b/configs/ini.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ini.c 327425 2012-09-02 03:58:49Z laruence $ */ +/* $Id: ini.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_config_ini_ce; @@ -823,7 +823,7 @@ zend_function_entry yaf_config_ini_methods[] = { YAF_STARTUP_FUNCTION(config_ini) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Ini", "Yaf\\Config\\Ini", yaf_config_ini_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Config_Ini", yaf_config_ini_methods); yaf_config_ini_ce = zend_register_internal_class_ex(&ce, yaf_config_ce, NULL TSRMLS_CC); #ifdef HAVE_SPL @@ -833,6 +833,7 @@ YAF_STARTUP_FUNCTION(config_ini) { #endif yaf_config_ini_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Config\\Ini", yaf_config_ini_ce); return SUCCESS; } diff --git a/configs/simple.c b/configs/simple.c index ca46145b..0009b571 100644 --- a/configs/simple.c +++ b/configs/simple.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simple.c 327425 2012-09-02 03:58:49Z laruence $ */ +/* $Id: simple.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_config_simple_ce; @@ -343,7 +343,7 @@ zend_function_entry yaf_config_simple_methods[] = { YAF_STARTUP_FUNCTION(config_simple) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Simple", "Yaf\\Config\\Simple", yaf_config_simple_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Config_Simple", yaf_config_simple_methods); yaf_config_simple_ce = zend_register_internal_class_ex(&ce, yaf_config_ce, NULL TSRMLS_CC); #ifdef HAVE_SPL @@ -354,6 +354,7 @@ YAF_STARTUP_FUNCTION(config_simple) { zend_declare_property_bool(yaf_config_simple_ce, ZEND_STRL(YAF_CONFIG_PROPERT_NAME_READONLY), 0, ZEND_ACC_PROTECTED TSRMLS_CC); yaf_config_simple_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Config\\Simple", yaf_config_simple_ce); return SUCCESS; } diff --git a/php_yaf.h b/php_yaf.h index 75bdd8da..2038bc3b 100644 --- a/php_yaf.h +++ b/php_yaf.h @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_yaf.h 327561 2012-09-09 06:30:22Z laruence $ */ +/* $Id: php_yaf.h 327565 2012-09-09 07:48:24Z laruence $ */ #ifndef PHP_YAF_H #define PHP_YAF_H @@ -119,9 +119,6 @@ ZEND_BEGIN_MODULE_GLOBALS(yaf) zval *active_ini_file_section; zval *ini_wanted_section; uint parsing_flag; -#ifdef YAF_HAVE_NAMESPACE - zend_bool use_namespace; -#endif ZEND_END_MODULE_GLOBALS(yaf) PHP_MINIT_FUNCTION(yaf); diff --git a/requests/http.c b/requests/http.c index 25293a56..983a8381 100644 --- a/requests/http.c +++ b/requests/http.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: http.c 327565 2012-09-09 07:48:24Z laruence $ */ #include "ext/standard/url.h" @@ -277,8 +277,9 @@ zend_function_entry yaf_request_http_methods[] = { */ YAF_STARTUP_FUNCTION(request_http){ zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Request_Http", "Yaf\\Request\\Http", yaf_request_http_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Request_Http", yaf_request_http_methods); yaf_request_http_ce = zend_register_internal_class_ex(&ce, yaf_request_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Request\\Http", yaf_request_http_ce); zend_declare_class_constant_string(yaf_request_ce, ZEND_STRL("SCHEME_HTTP"), "http" TSRMLS_CC); zend_declare_class_constant_string(yaf_request_ce, ZEND_STRL("SCHEME_HTTPS"), "https" TSRMLS_CC); diff --git a/requests/simple.c b/requests/simple.c index 6f7812fe..53aa2804 100644 --- a/requests/simple.c +++ b/requests/simple.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simple.c 327554 2012-09-09 04:49:24Z laruence $ */ +/* $Id: simple.c 327565 2012-09-09 07:48:24Z laruence $ */ static zend_class_entry *yaf_request_simple_ce; @@ -255,9 +255,11 @@ zend_function_entry yaf_request_simple_methods[] = { */ YAF_STARTUP_FUNCTION(request_simple){ zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Request_Simple", "Yaf\\Request\\Simple", yaf_request_simple_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Request_Simple", yaf_request_simple_methods); yaf_request_simple_ce = zend_register_internal_class_ex(&ce, yaf_request_ce, NULL TSRMLS_CC); yaf_request_simple_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Request\\Simple", yaf_request_simple_ce); zend_declare_class_constant_string(yaf_request_simple_ce, ZEND_STRL("SCHEME_HTTP"), "http" TSRMLS_CC); zend_declare_class_constant_string(yaf_request_simple_ce, ZEND_STRL("SCHEME_HTTPS"), "https" TSRMLS_CC); diff --git a/response/cli.c b/response/cli.c index 849618b5..98e036d5 100644 --- a/response/cli.c +++ b/response/cli.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cli.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: cli.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry * yaf_response_cli_ce; @@ -30,10 +30,9 @@ zend_function_entry yaf_response_cli_methods[] = { */ YAF_STARTUP_FUNCTION(response_cli) { zend_class_entry ce; - - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Response_Cli", "Yaf\\Response\\Cli", yaf_response_cli_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Response_Cli", yaf_response_cli_methods); yaf_response_cli_ce = zend_register_internal_class_ex(&ce, yaf_response_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Response\\Cli", yaf_response_cli_ce); return SUCCESS; } diff --git a/response/http.c b/response/http.c index e63f15e9..d0dac14d 100644 --- a/response/http.c +++ b/response/http.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: http.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_response_http_ce; @@ -30,9 +30,9 @@ zend_function_entry yaf_response_http_methods[] = { YAF_STARTUP_FUNCTION(response_http) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Response_Http", "Yaf\\Response\\Http", yaf_response_http_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Response_Http", yaf_response_http_methods); yaf_response_http_ce = zend_register_internal_class_ex(&ce, yaf_response_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Response\\Http", yaf_response_http_ce); zend_declare_property_bool(yaf_response_http_ce, ZEND_STRL(YAF_RESPONSE_PROPERTY_NAME_HEADEREXCEPTION), 1, ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_long(yaf_response_http_ce, ZEND_STRL(YAF_RESPONSE_PROPERTY_NAME_RESPONSECODE), 200, ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/routes/interface.c b/routes/interface.c index ffa153cd..8c7ed81b 100644 --- a/routes/interface.c +++ b/routes/interface.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interface.c 326042 2012-06-08 10:49:59Z laruence $ */ +/* $Id: interface.c 327565 2012-09-09 07:48:24Z laruence $ */ #include "ext/standard/php_smart_str.h" @@ -146,8 +146,10 @@ zend_function_entry yaf_route_methods[] = { */ YAF_STARTUP_FUNCTION(route) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Interface", "Yaf\\Route_Interface", yaf_route_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Route_Interface", yaf_route_methods); yaf_route_ce = zend_register_internal_interface(&ce TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Route_Interface", yaf_route_ce); YAF_STARTUP(route_static); YAF_STARTUP(route_simple); diff --git a/routes/map.c b/routes/map.c index 99e82298..d8357ac2 100644 --- a/routes/map.c +++ b/routes/map.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: map.c 327549 2012-09-09 03:02:48Z laruence $*/ +/* $Id: map.c 327565 2012-09-09 07:48:24Z laruence $*/ zend_class_entry *yaf_route_map_ce; @@ -174,9 +174,10 @@ zend_function_entry yaf_route_map_methods[] = { YAF_STARTUP_FUNCTION(route_map) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Map", "Yaf\\Route\\Map", yaf_route_map_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Route_Map", yaf_route_map_methods); yaf_route_map_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); zend_class_implements(yaf_route_map_ce TSRMLS_CC, 1, yaf_route_ce); + YAF_INIT_CLASS_ALIAS("Yaf\\Route\\Map", yaf_route_map_ce); yaf_route_map_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; diff --git a/routes/regex.c b/routes/regex.c index 00bbdb38..a57257dd 100644 --- a/routes/regex.c +++ b/routes/regex.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: regex.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: regex.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_route_regex_ce; @@ -237,10 +237,12 @@ zend_function_entry yaf_route_regex_methods[] = { */ YAF_STARTUP_FUNCTION(route_regex) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Regex", "Yaf\\Route\\Regex", yaf_route_regex_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Route_Regex", yaf_route_regex_methods); yaf_route_regex_ce = zend_register_internal_class_ex(&ce, yaf_route_ce, NULL TSRMLS_CC); zend_class_implements(yaf_route_regex_ce TSRMLS_CC, 1, yaf_route_ce); yaf_route_regex_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Route\\Regex", yaf_route_regex_ce); zend_declare_property_null(yaf_route_regex_ce, ZEND_STRL(YAF_ROUTE_PROPETY_NAME_MATCH), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_route_regex_ce, ZEND_STRL(YAF_ROUTE_PROPETY_NAME_ROUTE), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/routes/rewrite.c b/routes/rewrite.c index be3c6c9b..f5bbe59c 100644 --- a/routes/rewrite.c +++ b/routes/rewrite.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: rewrite.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: rewrite.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_route_rewrite_ce; @@ -298,10 +298,12 @@ zend_function_entry yaf_route_rewrite_methods[] = { */ YAF_STARTUP_FUNCTION(route_rewrite) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Rewrite", "Yaf\\Route\\Rewrite", yaf_route_rewrite_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Route_Rewrite", yaf_route_rewrite_methods); yaf_route_rewrite_ce = zend_register_internal_class_ex(&ce, yaf_route_ce, NULL TSRMLS_CC); zend_class_implements(yaf_route_rewrite_ce TSRMLS_CC, 1, yaf_route_ce); yaf_route_rewrite_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Route\\Rewrite", yaf_route_rewrite_ce); zend_declare_property_null(yaf_route_rewrite_ce, ZEND_STRL(YAF_ROUTE_PROPETY_NAME_MATCH), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_route_rewrite_ce, ZEND_STRL(YAF_ROUTE_PROPETY_NAME_ROUTE), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/routes/simple.c b/routes/simple.c index 1c725782..52fcb797 100644 --- a/routes/simple.c +++ b/routes/simple.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simple.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: simple.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_route_simple_ce; @@ -130,9 +130,10 @@ zend_function_entry yaf_route_simple_methods[] = { YAF_STARTUP_FUNCTION(route_simple) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Simple", "Yaf\\Route\\Simple", yaf_route_simple_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Route_Simple", yaf_route_simple_methods); yaf_route_simple_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); zend_class_implements(yaf_route_simple_ce TSRMLS_CC, 1, yaf_route_ce); + YAF_INIT_CLASS_ALIAS("Yaf\\Route\\Simple", yaf_route_simple_ce); yaf_route_simple_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; diff --git a/routes/static.c b/routes/static.c index f278c518..fdb040ea 100644 --- a/routes/static.c +++ b/routes/static.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: static.c 327548 2012-09-09 02:33:16Z laruence $ */ +/* $Id: static.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry * yaf_route_static_ce; @@ -196,9 +196,10 @@ zend_function_entry yaf_route_static_methods[] = { YAF_STARTUP_FUNCTION(route_static) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Static", "Yaf\\Route_Static", yaf_route_static_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Route_Static", yaf_route_static_methods); yaf_route_static_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); zend_class_implements(yaf_route_static_ce TSRMLS_CC, 1, yaf_router_ce); + YAF_INIT_CLASS_ALIAS("Yaf\\Route_Static", yaf_route_static_ce); return SUCCESS; } diff --git a/routes/supervar.c b/routes/supervar.c index 4a9cc50c..fd0f1bf0 100644 --- a/routes/supervar.c +++ b/routes/supervar.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: supervar.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: supervar.c 327565 2012-09-09 07:48:24Z laruence $ */ #define YAF_ROUTE_SUPERVAR_PROPETY_NAME_VAR "_var_name" @@ -116,10 +116,12 @@ zend_function_entry yaf_route_supervar_methods[] = { */ YAF_STARTUP_FUNCTION(route_supervar) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Supervar", "Yaf\\Route\\Supervar", yaf_route_supervar_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Route_Supervar", yaf_route_supervar_methods); yaf_route_supervar_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); zend_class_implements(yaf_route_supervar_ce TSRMLS_CC, 1, yaf_route_ce); yaf_route_supervar_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Route\\Supervar", yaf_route_supervar_ce); zend_declare_property_null(yaf_route_supervar_ce, ZEND_STRL(YAF_ROUTE_SUPERVAR_PROPETY_NAME_VAR), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/views/interface.c b/views/interface.c index d9cfb2b5..30d5a8ef 100644 --- a/views/interface.c +++ b/views/interface.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interface.c 327426 2012-09-02 04:01:00Z laruence $ */ +/* $Id: interface.c 327565 2012-09-09 07:48:24Z laruence $ */ zend_class_entry *yaf_view_interface_ce; @@ -59,8 +59,9 @@ zend_function_entry yaf_view_interface_methods[] = { */ YAF_STARTUP_FUNCTION(view_interface) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_View_Interface", "Yaf\\View_Interface", yaf_view_interface_methods); + INIT_CLASS_ENTRY(ce, "Yaf_View_Interface", yaf_view_interface_methods); yaf_view_interface_ce = zend_register_internal_interface(&ce TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\View_Interface", yaf_view_interface_ce); return SUCCESS; } diff --git a/views/simple.c b/views/simple.c index 03ded40c..3883bbab 100644 --- a/views/simple.c +++ b/views/simple.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simple.c 327562 2012-09-09 06:54:44Z laruence $ */ +/* $Id: simple.c 327565 2012-09-09 07:48:24Z laruence $ */ #include "main/php_output.h" @@ -897,8 +897,9 @@ zend_function_entry yaf_view_simple_methods[] = { YAF_STARTUP_FUNCTION(view_simple) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_View_Simple", "Yaf\\View\\Simple", yaf_view_simple_methods); + INIT_CLASS_ENTRY(ce, "Yaf_View_Simple", yaf_view_simple_methods); yaf_view_simple_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\View\\Simple", yaf_view_simple_ce); zend_declare_property_null(yaf_view_simple_ce, ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_view_simple_ce, ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLDIR), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf.c b/yaf.c index c7c03eaf..d2a9b86a 100644 --- a/yaf.c +++ b/yaf.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf.c 327514 2012-09-07 04:31:34Z laruence $ */ +/* $Id: yaf.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -78,9 +78,6 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("yaf.st_compatible", "0", PHP_INI_ALL, OnUpdateBool, st_compatible, zend_yaf_globals, yaf_globals) /* }}} */ STD_PHP_INI_ENTRY("yaf.environ", "product", PHP_INI_SYSTEM, OnUpdateString, environ, zend_yaf_globals, yaf_globals) -#ifdef YAF_HAVE_NAMESPACE - STD_PHP_INI_BOOLEAN("yaf.use_namespace", "0", PHP_INI_SYSTEM, OnUpdateBool, use_namespace, zend_yaf_globals, yaf_globals) -#endif PHP_INI_END(); /* }}} */ diff --git a/yaf_action.c b/yaf_action.c index 68d0461a..94f3c1ee 100644 --- a/yaf_action.c +++ b/yaf_action.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_action.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: yaf_action.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -61,9 +61,11 @@ zend_function_entry yaf_action_methods[] = { */ YAF_STARTUP_FUNCTION(action) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Action_Abstract", "Yaf\\Action_Abstract", yaf_action_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Action_Abstract", yaf_action_methods); yaf_action_ce = zend_register_internal_class_ex(&ce, yaf_controller_ce, NULL TSRMLS_CC); yaf_action_ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Action_Abstract", yaf_action_ce); zend_declare_property_null(yaf_action_ce, ZEND_STRL(YAF_ACTION_PROPERTY_NAME_CTRL), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_application.c b/yaf_application.c index 6d33c19a..ff11722a 100644 --- a/yaf_application.c +++ b/yaf_application.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_application.c 327549 2012-09-09 03:02:48Z laruence $ */ +/* $Id: yaf_application.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -750,10 +750,11 @@ zend_function_entry yaf_application_methods[] = { */ YAF_STARTUP_FUNCTION(application) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Application", "Yaf\\Application", yaf_application_methods); - yaf_application_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); + INIT_CLASS_ENTRY(ce, "Yaf_Application", yaf_application_methods); + yaf_application_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_application_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Application", yaf_application_ce); zend_declare_property_null(yaf_application_ce, ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_CONFIG), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_application_ce, ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_DISPATCHER), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_bootstrap.c b/yaf_bootstrap.c index 35ea86de..2d9f4f46 100644 --- a/yaf_bootstrap.c +++ b/yaf_bootstrap.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_bootstrap.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: yaf_bootstrap.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -41,9 +41,10 @@ zend_function_entry yaf_bootstrap_methods[] = { YAF_STARTUP_FUNCTION(bootstrap) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Bootstrap_Abstract", "Yaf\\Bootstrap_Abstract", yaf_bootstrap_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Bootstrap_Abstract", yaf_bootstrap_methods); yaf_bootstrap_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_bootstrap_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Bootstrap_Abstract", yaf_bootstrap_ce); return SUCCESS; } diff --git a/yaf_config.c b/yaf_config.c index 3070aba6..8bc7dfb1 100644 --- a/yaf_config.c +++ b/yaf_config.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_config.c 327559 2012-09-09 06:05:25Z laruence $ */ +/* $Id: yaf_config.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -379,9 +379,10 @@ zend_function_entry yaf_config_methods[] = { YAF_STARTUP_FUNCTION(config) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Abstract", "Yaf\\Config_Abstract", yaf_config_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Config_Abstract", yaf_config_methods); yaf_config_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_config_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Config_Abstract", yaf_config_ce); zend_declare_property_null(yaf_config_ce, ZEND_STRL(YAF_CONFIG_PROPERT_NAME), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_bool(yaf_config_ce, ZEND_STRL(YAF_CONFIG_PROPERT_NAME_READONLY), 1, ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_controller.c b/yaf_controller.c index 2c2bf752..c30d7f0b 100644 --- a/yaf_controller.c +++ b/yaf_controller.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_controller.c 327561 2012-09-09 06:30:22Z laruence $ */ +/* $Id: yaf_controller.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -564,9 +564,11 @@ zend_function_entry yaf_controller_methods[] = { */ YAF_STARTUP_FUNCTION(controller) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Controller_Abstract", "Yaf\\Controller_Abstract", yaf_controller_methods); + + INIT_CLASS_ENTRY(ce, "Yaf_Controller_Abstract", yaf_controller_methods); yaf_controller_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_controller_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Controller_Abstract", yaf_controller_ce); zend_declare_property_null(yaf_controller_ce, ZEND_STRL(YAF_CONTROLLER_PROPERTY_NAME_ACTIONS), ZEND_ACC_PUBLIC TSRMLS_CC); zend_declare_property_null(yaf_controller_ce, ZEND_STRL(YAF_CONTROLLER_PROPERTY_NAME_MODULE), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c index 4b5f9b8a..aae57969 100644 --- a/yaf_dispatcher.c +++ b/yaf_dispatcher.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_dispatcher.c 327562 2012-09-09 06:54:44Z laruence $ */ +/* $Id: yaf_dispatcher.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1364,10 +1364,10 @@ zend_function_entry yaf_dispatcher_methods[] = { YAF_STARTUP_FUNCTION(dispatcher) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Dispatcher", "Yaf\\Dispatcher", yaf_dispatcher_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Dispatcher", yaf_dispatcher_methods); yaf_dispatcher_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_dispatcher_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Dispatcher", yaf_dispatcher_ce); zend_declare_property_null(yaf_dispatcher_ce, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_ROUTER), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_dispatcher_ce, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_VIEW), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_exception.c b/yaf_exception.c index a6dc24fc..6d7536d2 100644 --- a/yaf_exception.c +++ b/yaf_exception.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_exception.c 325512 2012-05-03 08:22:37Z laruence $ */ +/* $Id: yaf_exception.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -166,38 +166,49 @@ YAF_STARTUP_FUNCTION(exception) { zend_class_entry view_notfound_ce; zend_class_entry type_ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Exception", "Yaf\\Exception", yaf_exception_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Exception", yaf_exception_methods); yaf_exception_ce = zend_register_internal_class_ex(&ce, yaf_get_exception_base(0 TSRMLS_CC), NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception", yaf_exception_ce); + zend_declare_property_null(yaf_exception_ce, ZEND_STRL("message"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_long(yaf_exception_ce, ZEND_STRL("code"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_exception_ce, ZEND_STRL("previous"), ZEND_ACC_PROTECTED TSRMLS_CC); - YAF_INIT_CLASS_ENTRY(startup_ce, "Yaf_Exception_StartupError", "Yaf\\Exception\\StartupError", NULL); + INIT_CLASS_ENTRY(startup_ce, "Yaf_Exception_StartupError", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_STARTUP_FAILED)] = zend_register_internal_class_ex(&startup_ce, yaf_exception_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\StartupError", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_STARTUP_FAILED)]); - YAF_INIT_CLASS_ENTRY(route_ce, "Yaf_Exception_RouterFailed", "Yaf\\Exception\\RouterFailed", NULL); + INIT_CLASS_ENTRY(route_ce, "Yaf_Exception_RouterFailed", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_ROUTE_FAILED)] = zend_register_internal_class_ex(&route_ce, yaf_exception_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\RouterFailed", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_ROUTE_FAILED)]); - YAF_INIT_CLASS_ENTRY(dispatch_ce, "Yaf_Exception_DispatchFailed", "Yaf\\Exception\\DispatchFailed", NULL); + INIT_CLASS_ENTRY(dispatch_ce, "Yaf_Exception_DispatchFailed", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_DISPATCH_FAILED)] = zend_register_internal_class_ex(&dispatch_ce, yaf_exception_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\DispatchFailed", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_DISPATCH_FAILED)]); - YAF_INIT_CLASS_ENTRY(loader_ce, "Yaf_Exception_LoadFailed", "Yaf\\Exception\\LoadFailed", NULL); + INIT_CLASS_ENTRY(loader_ce, "Yaf_Exception_LoadFailed", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)] = zend_register_internal_class_ex(&loader_ce, yaf_exception_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\LoadFailed", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)]); - YAF_INIT_CLASS_ENTRY(module_notfound_ce, "Yaf_Exception_LoadFailed_Module", "Yaf\\Exception\\LoadFailed\\Module", NULL); + INIT_CLASS_ENTRY(module_notfound_ce, "Yaf_Exception_LoadFailed_Module", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_MODULE)] = zend_register_internal_class_ex(&module_notfound_ce, yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)], NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\LoadFailed\\Module", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_MODULE)]); - YAF_INIT_CLASS_ENTRY(controller_notfound_ce, "Yaf_Exception_LoadFailed_Controller", "Yaf\\Exception\\LoadFailed\\Controller", NULL); + INIT_CLASS_ENTRY(controller_notfound_ce, "Yaf_Exception_LoadFailed_Controller", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_CONTROLLER)] = zend_register_internal_class_ex(&controller_notfound_ce, yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)], NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\LoadFailed\\Controller", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_CONTROLLER)]); - YAF_INIT_CLASS_ENTRY(action_notfound_ce, "Yaf_Exception_LoadFailed_Action", "Yaf\\Exception\\LoadFailed\\Action", NULL); + INIT_CLASS_ENTRY(action_notfound_ce, "Yaf_Exception_LoadFailed_Action", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_ACTION)] = zend_register_internal_class_ex(&action_notfound_ce, yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)], NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\LoadFailed\\Action", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_ACTION)]); - YAF_INIT_CLASS_ENTRY(view_notfound_ce, "Yaf_Exception_LoadFailed_View", "Yaf\\Exception\\LoadFailed\\View", NULL); + INIT_CLASS_ENTRY(view_notfound_ce, "Yaf_Exception_LoadFailed_View", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_VIEW)] = zend_register_internal_class_ex(&view_notfound_ce, yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_AUTOLOAD_FAILED)], NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\LoadFailed\\View", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_NOTFOUND_VIEW)]); - YAF_INIT_CLASS_ENTRY(type_ce, "Yaf_Exception_TypeError", "Yaf\\Exception\\TypeError", NULL); + INIT_CLASS_ENTRY(type_ce, "Yaf_Exception_TypeError", NULL); yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_TYPE_ERROR)] = zend_register_internal_class_ex(&type_ce, yaf_exception_ce, NULL TSRMLS_CC); + YAF_INIT_CLASS_ALIAS("Yaf\\Exception\\TypeError", yaf_buildin_exceptions[YAF_EXCEPTION_OFFSET(YAF_ERR_TYPE_ERROR)]); return SUCCESS; } diff --git a/yaf_loader.c b/yaf_loader.c index 7215de4e..26a072c2 100644 --- a/yaf_loader.c +++ b/yaf_loader.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_loader.c 327560 2012-09-09 06:09:27Z laruence $ */ +/* $Id: yaf_loader.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -987,9 +987,10 @@ zend_function_entry yaf_loader_methods[] = { YAF_STARTUP_FUNCTION(loader) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Loader", "Yaf\\Loader", yaf_loader_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Loader", yaf_loader_methods); yaf_loader_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_loader_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Loader", yaf_loader_ce); zend_declare_property_null(yaf_loader_ce, ZEND_STRL(YAF_LOADER_PROPERTY_NAME_LIBRARY), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_loader_ce, ZEND_STRL(YAF_LOADER_PROPERTY_NAME_GLOBAL_LIB), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_namespace.h b/yaf_namespace.h index 40df2c98..fbdd971b 100644 --- a/yaf_namespace.h +++ b/yaf_namespace.h @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_namespace.h 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: yaf_namespace.h 327565 2012-09-09 07:48:24Z laruence $ */ #ifndef YAF_NAMESPACE_H #define YAF_NAMESPACE_H @@ -23,26 +23,19 @@ #define YAF_BEGIN_ARG_INFO ZEND_BEGIN_ARG_INFO #define YAF_BEGIN_ARG_INFO_EX ZEND_BEGIN_ARG_INFO_EX -#define namespace_switch(n) \ - (YAF_G(use_namespace)? n##_ns : n) - -#define YAF_INIT_CLASS_ENTRY(ce, name, name_ns, methods) \ - if(YAF_G(use_namespace)) { \ - INIT_CLASS_ENTRY(ce, name_ns, methods); \ - } else { \ - INIT_CLASS_ENTRY(ce, name, methods); \ - } +#define YAF_INIT_CLASS_ALIAS(name, ce) \ + do {\ + zend_register_class_alias_ex(name, sizeof(name) - 1, ce TSRMLS_CC); \ + } while(0) #else #ifdef YAF_HAVE_NAMESPACE #undef YAF_HAVE_NAMESPACE #endif -#define namespace_switch(n) (n) -#define YAF_INIT_CLASS_ENTRY(ce, name, name_ns, methods) INIT_CLASS_ENTRY(ce, name, methods) +#define YAF_INIT_CLASS_ALIAS(name, ce) #define YAF_BEGIN_ARG_INFO static ZEND_BEGIN_ARG_INFO #define YAF_BEGIN_ARG_INFO_EX static ZEND_BEGIN_ARG_INFO_EX - #endif #define YAF_END_ARG_INFO ZEND_END_ARG_INFO diff --git a/yaf_plugin.c b/yaf_plugin.c index 50aadabe..c22c578b 100644 --- a/yaf_plugin.c +++ b/yaf_plugin.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_plugin.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: yaf_plugin.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -42,13 +42,6 @@ ZEND_BEGIN_ARG_INFO_EX(plugin_arg, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, request, Yaf_Request_Abstract, 0) ZEND_ARG_OBJ_INFO(0, response, Yaf_Response_Abstract, 0) ZEND_END_ARG_INFO() - -#ifdef YAF_HAVE_NAMESPACE -ZEND_BEGIN_ARG_INFO_EX(plugin_arg_ns, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, request, Yaf\\Request_Abstract, 0) - ZEND_ARG_OBJ_INFO(0, response, Yaf\\Response_Abstract, 0) -ZEND_END_ARG_INFO() -#endif /* }}} */ /** {{{ proto public Yaf_Plugin::routerStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstarct $response) @@ -104,36 +97,24 @@ PHP_METHOD(yaf_plugin, preResponse) { */ zend_function_entry yaf_plugin_methods[] = { PHP_ME(yaf_plugin, routerStartup, plugin_arg, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, routerShutdown, plugin_arg, ZEND_ACC_PUBLIC) + PHP_ME(yaf_plugin, routerShutdown, plugin_arg, ZEND_ACC_PUBLIC) PHP_ME(yaf_plugin, dispatchLoopStartup, plugin_arg, ZEND_ACC_PUBLIC) PHP_ME(yaf_plugin, dispatchLoopShutdown, plugin_arg, ZEND_ACC_PUBLIC) PHP_ME(yaf_plugin, preDispatch, plugin_arg, ZEND_ACC_PUBLIC) PHP_ME(yaf_plugin, postDispatch, plugin_arg, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, preResponse, plugin_arg, ZEND_ACC_PUBLIC) + PHP_ME(yaf_plugin, preResponse, plugin_arg, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; - -#ifdef YAF_HAVE_NAMESPACE -zend_function_entry yaf_plugin_methods_ns[] = { - PHP_ME(yaf_plugin, routerStartup, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, routerShutdown, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, dispatchLoopStartup, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, dispatchLoopShutdown, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, preDispatch, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, postDispatch, plugin_arg_ns, ZEND_ACC_PUBLIC) - PHP_ME(yaf_plugin, preResponse, plugin_arg_ns, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; -#endif /* }}} */ /** {{{ YAF_STARTUP_FUNCTION */ YAF_STARTUP_FUNCTION(plugin) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Plugin_Abstract", "Yaf\\Plugin_Abstract", namespace_switch(yaf_plugin_methods)); + INIT_CLASS_ENTRY(ce, "Yaf_Plugin_Abstract", yaf_plugin_methods); yaf_plugin_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_plugin_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Plugin_Abstract", yaf_plugin_ce); return SUCCESS; } diff --git a/yaf_registry.c b/yaf_registry.c index 8e0f0647..f90fcd59 100644 --- a/yaf_registry.c +++ b/yaf_registry.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_registry.c 321289 2011-12-21 02:53:29Z laruence $ */ +/* $Id: yaf_registry.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -208,10 +208,10 @@ zend_function_entry yaf_registry_methods[] = { YAF_STARTUP_FUNCTION(registry) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Registry", "Yaf\\Registry", yaf_registry_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Registry", yaf_registry_methods); yaf_registry_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_registry_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Registry", yaf_registry_ce); zend_declare_property_null(yaf_registry_ce, ZEND_STRL(YAF_REGISTRY_PROPERTY_NAME_INSTANCE), ZEND_ACC_PROTECTED|ZEND_ACC_STATIC TSRMLS_CC); zend_declare_property_null(yaf_registry_ce, ZEND_STRL(YAF_REGISTRY_PROPERTY_NAME_ENTRYS), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_request.c b/yaf_request.c index 778fbe71..df9716c1 100644 --- a/yaf_request.c +++ b/yaf_request.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_request.c 327552 2012-09-09 03:52:28Z laruence $*/ +/* $Id: yaf_request.c 327565 2012-09-09 07:48:24Z laruence $*/ #ifdef HAVE_CONFIG_H #include "config.h" @@ -824,9 +824,10 @@ zend_function_entry yaf_request_methods[] = { YAF_STARTUP_FUNCTION(request){ zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Request_Abstract", "Yaf\\Request_Abstract", yaf_request_methods); - yaf_request_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); + INIT_CLASS_ENTRY(ce, "Yaf_Request_Abstract", yaf_request_methods); + yaf_request_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_request_ce->ce_flags = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Request_Abstract", yaf_request_ce); zend_declare_property_null(yaf_request_ce, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_MODULE), ZEND_ACC_PUBLIC TSRMLS_CC); zend_declare_property_null(yaf_request_ce, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_CONTROLLER), ZEND_ACC_PUBLIC TSRMLS_CC); diff --git a/yaf_response.c b/yaf_response.c index 6ef230c7..ae63584b 100644 --- a/yaf_response.c +++ b/yaf_response.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_response.c 327560 2012-09-09 06:09:27Z laruence $ */ +/* $Id: yaf_response.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -458,10 +458,10 @@ zend_function_entry yaf_response_methods[] = { YAF_STARTUP_FUNCTION(response) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Response_Abstract", "Yaf\\Response_Abstract", yaf_response_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Response_Abstract", yaf_response_methods); yaf_response_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_response_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Response_Abstract", yaf_response_ce); zend_declare_property_null(yaf_response_ce, ZEND_STRL(YAF_RESPONSE_PROPERTY_NAME_HEADER), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_response_ce, ZEND_STRL(YAF_RESPONSE_PROPERTY_NAME_BODY), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_router.c b/yaf_router.c index 3817b028..fa552636 100644 --- a/yaf_router.c +++ b/yaf_router.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_router.c 327425 2012-09-02 03:58:49Z laruence $ */ +/* $Id: yaf_router.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -363,10 +363,10 @@ zend_function_entry yaf_router_methods[] = { YAF_STARTUP_FUNCTION(router) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Router", "Yaf\\Router", yaf_router_methods); + INIT_CLASS_ENTRY(ce, "Yaf_Router", yaf_router_methods); yaf_router_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); - yaf_router_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Router", yaf_router_ce); zend_declare_property_null(yaf_router_ce, ZEND_STRL(YAF_ROUTER_PROPERTY_NAME_ROUTERS), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(yaf_router_ce, ZEND_STRL(YAF_ROUTER_PROPERTY_NAME_CURRENT_ROUTE), ZEND_ACC_PROTECTED TSRMLS_CC); diff --git a/yaf_session.c b/yaf_session.c index ac60f0e7..ae36386d 100644 --- a/yaf_session.c +++ b/yaf_session.c @@ -14,7 +14,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: yaf_session.c 327425 2012-09-02 03:58:49Z laruence $ */ +/* $Id: yaf_session.c 327565 2012-09-09 07:48:24Z laruence $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -353,10 +353,10 @@ zend_function_entry yaf_session_methods[] = { YAF_STARTUP_FUNCTION(session) { zend_class_entry ce; - YAF_INIT_CLASS_ENTRY(ce, "Yaf_Session", "Yaf\\Session", yaf_session_methods); - + INIT_CLASS_ENTRY(ce, "Yaf_Session", yaf_session_methods); yaf_session_ce = zend_register_internal_class_ex(&ce, NULL, NULL TSRMLS_CC); yaf_session_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; + YAF_INIT_CLASS_ALIAS("Yaf\\Session", yaf_session_ce); #ifdef HAVE_SPL zend_class_implements(yaf_session_ce TSRMLS_CC, 3, zend_ce_iterator, zend_ce_arrayaccess, spl_ce_Countable);