diff --git a/config.h b/config.h new file mode 100644 index 00000000..f4482434 --- /dev/null +++ b/config.h @@ -0,0 +1,59 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Whether to build yaf as dynamic module */ +#define COMPILE_DL_YAF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* define to 1 if you want to change the POST/GET by php script */ +#define PHP_YAF_DEBUG 0 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 diff --git a/config.m4 b/config.m4 index fe97b239..4119f114 100644 --- a/config.m4 +++ b/config.m4 @@ -41,5 +41,37 @@ if test "$PHP_YAF" != "no"; then else AC_MSG_RESULT([$php_version, ok]) fi - PHP_NEW_EXTENSION(yaf, yaf.c yaf_application.c yaf_bootstrap.c yaf_dispatcher.c yaf_exception.c yaf_config.c yaf_request.c yaf_response.c yaf_view.c yaf_controller.c yaf_action.c yaf_router.c yaf_loader.c yaf_registry.c yaf_plugin.c yaf_session.c, $ext_shared) + PHP_NEW_EXTENSION(yaf, + yaf.c \ + yaf_application.c \ + yaf_bootstrap.c \ + yaf_dispatcher.c \ + yaf_exception.c \ + yaf_config.c \ + configs/ini.c \ + configs/simple.c \ + yaf_request.c \ + requests/http.c \ + requests/simple.c \ + yaf_response.c \ + response/http.c \ + response/cli.c \ + yaf_view.c \ + views/interface.c \ + views/simple.c \ + yaf_controller.c \ + yaf_action.c \ + yaf_router.c \ + routes/interface.c \ + routes/static.c \ + routes/simple.c \ + routes/supervar.c \ + routes/regex.c \ + routes/rewrite.c \ + routes/map.c \ + yaf_loader.c \ + yaf_registry.c \ + yaf_plugin.c \ + yaf_session.c, + $ext_shared) fi diff --git a/config.w32 b/config.w32 index 76cf1e4f..29b604fd 100644 --- a/config.w32 +++ b/config.w32 @@ -4,7 +4,6 @@ ARG_ENABLE("yaf", "enable yaf support", "no"); if (PHP_YAF == "yes") { - EXTENSION("yaf", "yaf.c yaf_application.c yaf_loader.c yaf_bootstrap.c yaf_config.c yaf_dispatcher.c yaf_registry.c yaf_controller.c yaf_action.c yaf_view.c yaf_request.c yaf_response.c yaf_router.c yaf_exception.c yaf_plugin.c yaf_session.c"); - - AC_DEFINE("HAVE_YAF", 1, "Have Yaf Support"); + EXTENSION("yaf", "yaf.c yaf_application.c yaf_bootstrap.c yaf_dispatcher.c yaf_exception.c yaf_config.c configs/ini.c configs/simple.c yaf_request.c requests/http.c requests/simple.c yaf_response.c response/http.c response/cli.c yaf_view.c views/interface.c views/simple.c yaf_controller.c yaf_action.c yaf_router.c routes/interface.c routes/static.c routes/simple.c routes/supervar.c routes/regex.c routes/rewrite.c routes/map.c yaf_loader.c yaf_registry.c yaf_plugin.c yaf_session.c"); + AC_DEFINE("HAVE_YAF", 1, "Have Yaf Support"); } diff --git a/configs/ini.c b/configs/ini.c index 73207ebc..d521685d 100644 --- a/configs/ini.c +++ b/configs/ini.c @@ -16,16 +16,31 @@ /* $Id: ini.c 329002 2013-01-07 12:55:53Z laruence $ */ -zend_class_entry *yaf_config_ini_ce; +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -yaf_config_t * yaf_config_ini_instance(yaf_config_t *this_ptr, zval *filename, zval *section TSRMLS_DC); +#include "php.h" +#include "php_ini.h" +#include "Zend/zend_interfaces.h" -#define YAF_CONFIG_INI_PARSING_START 0 -#define YAF_CONFIG_INI_PARSING_PROCESS 1 -#define YAF_CONFIG_INI_PARSING_END 2 +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_config.h" +#include "configs/ini.h" + +zend_class_entry *yaf_config_ini_ce; + +#ifdef HAVE_SPL +extern PHPAPI zend_class_entry *spl_ce_Countable; +#endif /** {{{ ARG_INFO */ +ZEND_BEGIN_ARG_INFO_EX(yaf_config_ini_void_arginfo, 0, 0, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(yaf_config_ini_construct_arginfo, 0, 0, 1) ZEND_ARG_INFO(0, config_file) ZEND_ARG_INFO(0, section) @@ -808,14 +823,14 @@ zend_function_entry yaf_config_ini_methods[] = { PHP_ME(yaf_config_ini, __isset, yaf_config_ini_isset_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_ini, get, yaf_config_ini_get_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_ini, set, yaf_config_ini_set_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, count, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, rewind, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, current, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, next, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, valid, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, key, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, toArray, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_ini, readonly, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, count, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, rewind, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, current, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, next, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, valid, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, key, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, toArray, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_ini, readonly, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_ini, offsetUnset, yaf_config_ini_unset_arginfo, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_ini, offsetGet, get, yaf_config_ini_rget_arginfo, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_ini, offsetExists, __isset, yaf_config_ini_isset_arginfo, ZEND_ACC_PUBLIC) diff --git a/configs/ini.h b/configs/ini.h new file mode 100644 index 00000000..b2fbed7e --- /dev/null +++ b/configs/ini.h @@ -0,0 +1,40 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_config.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_CONFIG_INI_H +#define YAF_CONFIG_INI_H + +#define YAF_CONFIG_INI_PARSING_START 0 +#define YAF_CONFIG_INI_PARSING_PROCESS 1 +#define YAF_CONFIG_INI_PARSING_END 2 + +extern zend_class_entry *yaf_config_ini_ce; + +yaf_config_t * yaf_config_ini_instance(yaf_config_t *this_ptr, zval *filename, zval *section TSRMLS_DC); + +YAF_STARTUP_FUNCTION(config_ini); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/configs/simple.c b/configs/simple.c index 342f2300..b2e71e5d 100644 --- a/configs/simple.c +++ b/configs/simple.c @@ -16,10 +16,30 @@ /* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "Zend/zend_interfaces.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_config.h" +#include "configs/simple.h" + zend_class_entry *yaf_config_simple_ce; +#ifdef HAVE_SPL +extern PHPAPI zend_class_entry *spl_ce_Countable; +#endif + /** {{{ ARG_INFO */ +ZEND_BEGIN_ARG_INFO_EX(yaf_config_simple_void_arginfo, 0, 0, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(yaf_config_simple_construct_arginfo, 0, 0, 1) ZEND_ARG_INFO(0, config_file) ZEND_ARG_INFO(0, section) @@ -325,15 +345,15 @@ zend_function_entry yaf_config_simple_methods[] = { PHP_ME(yaf_config_simple, __isset, yaf_config_simple_isset_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_simple, get, yaf_config_simple_get_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_simple, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, count, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, count, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) PHP_ME(yaf_config_simple, offsetUnset, yaf_config_simple_unset_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, rewind, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, current, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, next, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, valid, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, key, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, readonly, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) - PHP_ME(yaf_config_simple, toArray, yaf_config_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, rewind, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, current, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, next, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, valid, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, key, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, readonly, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) + PHP_ME(yaf_config_simple, toArray, yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_simple, __set, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_simple, __get, get, yaf_config_simple_get_arginfo, ZEND_ACC_PUBLIC) PHP_MALIAS(yaf_config_simple, offsetGet, get, yaf_config_simple_rget_arginfo, ZEND_ACC_PUBLIC) diff --git a/configs/simple.h b/configs/simple.h new file mode 100644 index 00000000..fce6aec8 --- /dev/null +++ b/configs/simple.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_config.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_CONFIG_SIMPLE_H +#define YAF_CONFIG_SIMPLE_H + +extern zend_class_entry *yaf_config_simple_ce; + +yaf_config_t * yaf_config_simple_instance(yaf_config_t *this_ptr, zval *values, zval *readonly TSRMLS_DC); + +YAF_STARTUP_FUNCTION(config_simple); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/requests/http.c b/requests/http.c index 1ac14f0c..10c1e380 100644 --- a/requests/http.c +++ b/requests/http.c @@ -16,7 +16,20 @@ /* $Id: http.c 329002 2013-01-07 12:55:53Z laruence $ */ -#include "ext/standard/url.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "main/SAPI.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_request.h" +#include "yaf_exception.h" +#include "requests/http.h" + +#include "ext/standard/url.h" /* for php_url */ static zend_class_entry * yaf_request_http_ce; diff --git a/requests/http.h b/requests/http.h new file mode 100644 index 00000000..1816a2f4 --- /dev/null +++ b/requests/http.h @@ -0,0 +1,33 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_request.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_REQUEST_HTTP_H +#define YAF_REQUEST_HTTP_H + +yaf_request_t * yaf_request_http_instance(yaf_request_t *this_ptr, char *request_uri, char *base_uri TSRMLS_DC); +YAF_STARTUP_FUNCTION(request_http); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/requests/simple.c b/requests/simple.c index cee7e4b2..491ec8b7 100644 --- a/requests/simple.c +++ b/requests/simple.c @@ -16,6 +16,19 @@ /* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "main/SAPI.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_request.h" +#include "yaf_exception.h" +#include "requests/simple.h" + static zend_class_entry *yaf_request_simple_ce; /** {{{ yaf_request_t * yaf_request_simple_instance(yaf_request_t *this_ptr, zval *module, zval *controller, zval *action, zval *method, zval *params TSRMLS_DC) diff --git a/requests/simple.h b/requests/simple.h new file mode 100644 index 00000000..f1d939d8 --- /dev/null +++ b/requests/simple.h @@ -0,0 +1,33 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_request.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_REQUEST_SIMPLE_H +#define YAF_REQUEST_SIMPLE_H + +yaf_request_t * yaf_request_simple_instance(yaf_request_t *this_ptr, zval *module, zval *controller, zval *action, zval *method, zval *params TSRMLS_DC); +YAF_STARTUP_FUNCTION(request_simple); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/response/cli.c b/response/cli.c index 7c19fa35..eebf555d 100644 --- a/response/cli.c +++ b/response/cli.c @@ -16,6 +16,17 @@ /* $Id: cli.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_response.h" +#include "yaf_exception.h" +#include "response/cli.h" zend_class_entry * yaf_response_cli_ce; diff --git a/response/cli.h b/response/cli.h new file mode 100644 index 00000000..4fae8de1 --- /dev/null +++ b/response/cli.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_response.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef PHP_YAF_RESPONSE_CLI_H +#define PHP_YAF_RESPONSE_CLI_H + +extern zend_class_entry *yaf_response_cli_ce; + +YAF_STARTUP_FUNCTION(response_cli); + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/response/http.c b/response/http.c index c72fd142..d8a60d61 100644 --- a/response/http.c +++ b/response/http.c @@ -16,6 +16,18 @@ /* $Id: http.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_response.h" +#include "yaf_exception.h" +#include "response/http.h" + zend_class_entry *yaf_response_http_ce; /** {{{ yaf_response_methods diff --git a/response/http.h b/response/http.h new file mode 100644 index 00000000..a46c37e6 --- /dev/null +++ b/response/http.h @@ -0,0 +1,35 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_response.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef PHP_YAF_RESPONSE_HTTP_H +#define PHP_YAF_RESPONSE_HTTP_H + +extern zend_class_entry *yaf_response_http_ce; + +YAF_STARTUP_FUNCTION(response_http); + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/interface.c b/routes/interface.c index c77f0907..00d992b4 100644 --- a/routes/interface.c +++ b/routes/interface.c @@ -14,33 +14,29 @@ +----------------------------------------------------------------------+ */ -/* $Id: interface.c 329002 2013-01-07 12:55:53Z laruence $ */ +/* $Id: interface.c 329154 2013-01-16 04:02:46Z laruence $ */ -#include "ext/standard/php_smart_str.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -#define YAF_ROUTE_PROPETY_NAME_MATCH "_route" -#define YAF_ROUTE_PROPETY_NAME_ROUTE "_default" -#define YAF_ROUTE_PROPETY_NAME_MAP "_maps" -#define YAF_ROUTE_PROPETY_NAME_VERIFY "_verify" +#include "php.h" -#define YAF_ROUTER_URL_DELIMIETER "/" -#define YAF_ROUTE_REGEX_DILIMITER '#' +#include "php_yaf.h" -/* {{{ YAF_ARG_INFO - */ -YAF_BEGIN_ARG_INFO_EX(yaf_route_route_arginfo, 0, 0, 1) - YAF_ARG_INFO(0, request) -YAF_END_ARG_INFO() -/* }}} */ +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_router.h" -zend_class_entry *yaf_route_ce; +#include "routes/interface.h" +#include "routes/static.h" +#include "routes/simple.h" +#include "routes/supervar.h" +#include "routes/regex.h" +#include "routes/rewrite.h" +#include "routes/map.h" -#include "static.c" -#include "simple.c" -#include "supervar.c" -#include "rewrite.c" -#include "regex.c" -#include "map.c" +zend_class_entry *yaf_route_ce; /* {{{ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC) */ @@ -146,16 +142,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); yaf_route_ce = zend_register_internal_interface(&ce TSRMLS_CC); - YAF_STARTUP(route_static); - YAF_STARTUP(route_simple); - YAF_STARTUP(route_supervar); - YAF_STARTUP(route_rewrite); - YAF_STARTUP(route_regex); - YAF_STARTUP(route_map); - return SUCCESS; } /* }}} */ diff --git a/routes/interface.h b/routes/interface.h new file mode 100644 index 00000000..e6a07af6 --- /dev/null +++ b/routes/interface.h @@ -0,0 +1,48 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_INTERFACE_H +#define YAF_ROUTER_INTERFACE_H + +#define YAF_ROUTE_PROPETY_NAME_MATCH "_route" +#define YAF_ROUTE_PROPETY_NAME_ROUTE "_default" +#define YAF_ROUTE_PROPETY_NAME_MAP "_maps" +#define YAF_ROUTE_PROPETY_NAME_VERIFY "_verify" + +#define YAF_ROUTER_URL_DELIMIETER "/" +#define YAF_ROUTE_REGEX_DILIMITER '#' + +YAF_BEGIN_ARG_INFO_EX(yaf_route_route_arginfo, 0, 0, 1) + YAF_ARG_INFO(0, request) +YAF_END_ARG_INFO() + +extern zend_class_entry *yaf_route_ce; + +yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_interface); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/map.c b/routes/map.c index 293520d1..3ec1a5c7 100644 --- a/routes/map.c +++ b/routes/map.c @@ -16,10 +16,23 @@ /* $Id: map.c 329002 2013-01-07 12:55:53Z laruence $*/ -zend_class_entry *yaf_route_map_ce; +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "ext/standard/php_smart_str.h" /* for smart_str */ + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" -#define YAF_ROUTE_MAP_VAR_NAME_DELIMETER "_delimeter" -#define YAF_ROUTE_MAP_VAR_NAME_CTL_PREFER "_ctl_router" +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/map.h" + +zend_class_entry *yaf_route_map_ce; /** {{{ ARG_INFO */ diff --git a/routes/map.h b/routes/map.h new file mode 100644 index 00000000..d6fb2d6d --- /dev/null +++ b/routes/map.h @@ -0,0 +1,39 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_MAP_H +#define YAF_ROUTER_MAP_H + +#define YAF_ROUTE_MAP_VAR_NAME_DELIMETER "_delimeter" +#define YAF_ROUTE_MAP_VAR_NAME_CTL_PREFER "_ctl_router" + +extern zend_class_entry *yaf_route_map_ce; + +yaf_route_t * yaf_route_map_instance(yaf_route_t *this_ptr, zend_bool controller_prefer, char *delim, uint len TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_map); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/regex.c b/routes/regex.c index 547b2520..efb7753d 100644 --- a/routes/regex.c +++ b/routes/regex.c @@ -14,7 +14,23 @@ +----------------------------------------------------------------------+ */ -/* $Id: regex.c 329133 2013-01-14 07:24:17Z laruence $ */ +/* $Id: regex.c 329154 2013-01-16 04:02:46Z laruence $ */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "ext/pcre/php_pcre.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" + +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/regex.h" zend_class_entry *yaf_route_regex_ce; diff --git a/routes/regex.h b/routes/regex.h new file mode 100644 index 00000000..9874411e --- /dev/null +++ b/routes/regex.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_REGEX_H +#define YAF_ROUTER_REGEX_H + +extern zend_class_entry *yaf_route_regex_ce; + +yaf_route_t * yaf_route_regex_instance(yaf_route_t *this_ptr, zval *route, zval *def, zval *map, zval *verify TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_regex); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/rewrite.c b/routes/rewrite.c index 6979dd28..95be148c 100644 --- a/routes/rewrite.c +++ b/routes/rewrite.c @@ -16,6 +16,23 @@ /* $Id: rewrite.c 329133 2013-01-14 07:24:17Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "ext/standard/php_smart_str.h" /* for smart_str */ +#include "ext/pcre/php_pcre.h" /* for pcre */ + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" + +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/rewrite.h" + zend_class_entry *yaf_route_rewrite_ce; /** {{{ ARG_INFO diff --git a/routes/rewrite.h b/routes/rewrite.h new file mode 100644 index 00000000..260bb964 --- /dev/null +++ b/routes/rewrite.h @@ -0,0 +1,36 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_REWRITE_H +#define YAF_ROUTER_REWRITE_H + +extern zend_class_entry *yaf_route_rewrite_ce; + +yaf_route_t * yaf_route_rewrite_instance(yaf_route_t *this_ptr, zval *match, zval *router, zval *verify TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_rewrite); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/simple.c b/routes/simple.c index 2ebbb344..4ad23eea 100644 --- a/routes/simple.c +++ b/routes/simple.c @@ -16,11 +16,22 @@ /* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */ -zend_class_entry *yaf_route_simple_ce; +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" -#define YAF_ROUTE_SIMPLE_VAR_NAME_MODULE "module" -#define YAF_ROUTE_SIMPLE_VAR_NAME_CONTROLLER "controller" -#define YAF_ROUTE_SIMPLE_VAR_NAME_ACTION "action" +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/simple.h" + +zend_class_entry *yaf_route_simple_ce; /** {{{ ARG_INFO */ diff --git a/routes/simple.h b/routes/simple.h new file mode 100644 index 00000000..6cba7c82 --- /dev/null +++ b/routes/simple.h @@ -0,0 +1,40 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_SIMPLE_H +#define YAF_ROUTER_SIMPLE_H + +#define YAF_ROUTE_SIMPLE_VAR_NAME_MODULE "module" +#define YAF_ROUTE_SIMPLE_VAR_NAME_CONTROLLER "controller" +#define YAF_ROUTE_SIMPLE_VAR_NAME_ACTION "action" + +extern zend_class_entry *yaf_route_simple_ce; + +yaf_route_t * yaf_route_simple_instance(yaf_route_t *this_ptr, zval *module, zval *controller, zval *action TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_simple); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/static.c b/routes/static.c index db182647..e411735f 100644 --- a/routes/static.c +++ b/routes/static.c @@ -16,6 +16,21 @@ /* $Id: static.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" + +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/static.h" + zend_class_entry * yaf_route_static_ce; /** {{{ ARG_INFO @@ -162,7 +177,7 @@ int yaf_route_static_route(yaf_route_t *route, yaf_request_t *request TSRMLS_DC) } /* }}} */ -/** {{{ proto public Yaf_Router_Classical::route(Yaf_Request $req) +/** {{{ proto public Yaf_Router_Static::route(Yaf_Request $req) */ PHP_METHOD(yaf_route_static, route) { yaf_request_t *request; @@ -175,7 +190,7 @@ PHP_METHOD(yaf_route_static, route) { } /* }}} */ -/** {{{ proto public Yaf_Router_Classical::match(string $uri) +/** {{{ proto public Yaf_Router_Static::match(string $uri) */ PHP_METHOD(yaf_route_static, match) { RETURN_TRUE; diff --git a/routes/static.h b/routes/static.h new file mode 100644 index 00000000..84e4300a --- /dev/null +++ b/routes/static.h @@ -0,0 +1,34 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_STATIC_H +#define YAF_ROUTER_STATIC_H + +extern zend_class_entry *yaf_route_static_ce; + +YAF_STARTUP_FUNCTION(router_static); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/routes/supervar.c b/routes/supervar.c index e546f67e..1ad1059a 100644 --- a/routes/supervar.c +++ b/routes/supervar.c @@ -16,7 +16,20 @@ /* $Id: supervar.c 329002 2013-01-07 12:55:53Z laruence $ */ -#define YAF_ROUTE_SUPERVAR_PROPETY_NAME_VAR "_var_name" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" + +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_request.h" + +#include "yaf_router.h" +#include "routes/interface.h" +#include "routes/supervar.h" zend_class_entry *yaf_route_supervar_ce; diff --git a/routes/supervar.h b/routes/supervar.h new file mode 100644 index 00000000..8304da08 --- /dev/null +++ b/routes/supervar.h @@ -0,0 +1,38 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_ROUTER_SUPERVAR_H +#define YAF_ROUTER_SUPERVAR_H + +#define YAF_ROUTE_SUPERVAR_PROPETY_NAME_VAR "_var_name" + +extern zend_class_entry *yaf_route_supervar_ce; + +yaf_route_t * yaf_route_supervar_instance(yaf_route_t *this_ptr, zval *name TSRMLS_DC); + +YAF_STARTUP_FUNCTION(router_supervar); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/views/interface.c b/views/interface.c index 8d4eebd0..5cfc35d5 100644 --- a/views/interface.c +++ b/views/interface.c @@ -16,32 +16,21 @@ /* $Id: interface.c 329002 2013-01-07 12:55:53Z laruence $ */ -zend_class_entry *yaf_view_interface_ce; - -/* {{{ ARG_INFO - */ -ZEND_BEGIN_ARG_INFO_EX(yaf_view_assign_arginfo, 0, 0, 1) - ZEND_ARG_INFO(0, name) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO() +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif -ZEND_BEGIN_ARG_INFO_EX(yaf_view_display_arginfo, 0, 0, 1) - ZEND_ARG_INFO(0, tpl) - ZEND_ARG_INFO(0, tpl_vars) -ZEND_END_ARG_INFO() +#include "php.h" -ZEND_BEGIN_ARG_INFO_EX(yaf_view_render_arginfo, 0, 0, 1) - ZEND_ARG_INFO(0, tpl) - ZEND_ARG_INFO(0, tpl_vars) -ZEND_END_ARG_INFO() +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_loader.h" +#include "yaf_view.h" -ZEND_BEGIN_ARG_INFO_EX(yaf_view_setpath_arginfo, 0, 0, 1) - ZEND_ARG_INFO(0, template_dir) -ZEND_END_ARG_INFO() +#include "views/interface.h" -ZEND_BEGIN_ARG_INFO_EX(yaf_view_getpath_arginfo, 0, 0, 0) -ZEND_END_ARG_INFO() -/* }}} */ +zend_class_entry *yaf_view_interface_ce; /** {{{ yaf_view_interface_methods */ diff --git a/views/interface.h b/views/interface.h new file mode 100644 index 00000000..bb7e57c2 --- /dev/null +++ b/views/interface.h @@ -0,0 +1,56 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_view.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_VIEW_INTERFACE_H +#define YAF_VIEW_INTERFACE_H + +YAF_BEGIN_ARG_INFO_EX(yaf_view_assign_arginfo, 0, 0, 1) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, value) +YAF_END_ARG_INFO() + +YAF_BEGIN_ARG_INFO_EX(yaf_view_display_arginfo, 0, 0, 1) + ZEND_ARG_INFO(0, tpl) + ZEND_ARG_INFO(0, tpl_vars) +YAF_END_ARG_INFO() + +YAF_BEGIN_ARG_INFO_EX(yaf_view_render_arginfo, 0, 0, 1) + ZEND_ARG_INFO(0, tpl) + ZEND_ARG_INFO(0, tpl_vars) +YAF_END_ARG_INFO() + +YAF_BEGIN_ARG_INFO_EX(yaf_view_setpath_arginfo, 0, 0, 1) + ZEND_ARG_INFO(0, template_dir) +YAF_END_ARG_INFO() + +YAF_BEGIN_ARG_INFO_EX(yaf_view_getpath_arginfo, 0, 0, 0) +YAF_END_ARG_INFO() + +extern zend_class_entry *yaf_view_interface_ce; + +YAF_STARTUP_FUNCTION(view_interface); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/views/simple.c b/views/simple.c index f6945013..b8e44f4d 100644 --- a/views/simple.c +++ b/views/simple.c @@ -16,10 +16,21 @@ /* $Id: simple.c 329002 2013-01-07 12:55:53Z laruence $ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" #include "main/php_output.h" -#define VIEW_BUFFER_BLOCK_SIZE 4096 -#define VIEW_BUFFER_SIZE_MASK 4095 +#include "php_yaf.h" +#include "yaf_namespace.h" +#include "yaf_exception.h" +#include "yaf_loader.h" +#include "yaf_view.h" + +#include "views/interface.h" +#include "views/simple.h" zend_class_entry *yaf_view_simple_ce; @@ -31,7 +42,7 @@ ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(yaf_view_simple_get_arginfo, 0, 0, 0) ZEND_ARG_INFO(0, name) -ZEND_END_ARG_INFO(); +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(yaf_view_simple_isset_arginfo, 0, 0, 1) ZEND_ARG_INFO(0, name) diff --git a/views/simple.h b/views/simple.h new file mode 100644 index 00000000..959ea2b9 --- /dev/null +++ b/views/simple.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | Yet Another Framework | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Xinchen Hui | + +----------------------------------------------------------------------+ +*/ + +/* $Id: yaf_view.h 329002 2013-01-07 12:55:53Z laruence $ */ + +#ifndef YAF_VIEW_SIMPLE_H +#define YAF_VIEW_SIMPLE_H + +#define VIEW_BUFFER_BLOCK_SIZE 4096 +#define VIEW_BUFFER_SIZE_MASK 4095 + +extern zend_class_entry *yaf_view_simple_ce; + +YAF_STARTUP_FUNCTION(view_simple); + +#endif +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/yaf_action.c b/yaf_action.c index 9887e02f..3d89a9dd 100644 --- a/yaf_action.c +++ b/yaf_action.c @@ -21,8 +21,6 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_application.c b/yaf_application.c index 7c59606c..70c63a7e 100644 --- a/yaf_application.c +++ b/yaf_application.c @@ -21,11 +21,8 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" -#include "ext/standard/php_var.h" -#include "ext/standard/basic_functions.h" +#include "php_ini.h" /* for zend_alter_ini_entry */ +#include "Zend/zend_interfaces.h" /* for zend_call_method_with_* */ #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_bootstrap.c b/yaf_bootstrap.c index 1d547ee0..baa15711 100644 --- a/yaf_bootstrap.c +++ b/yaf_bootstrap.c @@ -21,7 +21,6 @@ #endif #include "php.h" -#include "main/SAPI.h" #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_config.c b/yaf_config.c index 3c64a319..43113625 100644 --- a/yaf_config.c +++ b/yaf_config.c @@ -22,22 +22,19 @@ #include "php.h" #include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_alloc.h" -#include "ext/standard/php_string.h" -#include "ext/standard/php_filestat.h" #include "php_yaf.h" #include "yaf_namespace.h" #include "yaf_exception.h" #include "yaf_config.h" +#include "configs/ini.h" +#include "configs/simple.h" + zend_class_entry *yaf_config_ce; -#ifdef HAVE_SPL -extern PHPAPI zend_class_entry *spl_ce_Countable; -#endif + +static zval * yaf_config_ini_zval_persistent(zval *zvalue TSRMLS_DC); +static zval * yaf_config_ini_zval_losable(zval *zvalue TSRMLS_DC); /* {{{ ARG_INFO */ @@ -45,12 +42,6 @@ ZEND_BEGIN_ARG_INFO_EX(yaf_config_void_arginfo, 0, 0, 0) ZEND_END_ARG_INFO() /* }}} */ -#include "configs/ini.c" -#include "configs/simple.c" - -static zval * yaf_config_ini_zval_persistent(zval *zvalue TSRMLS_DC); -static zval * yaf_config_ini_zval_losable(zval *zvalue TSRMLS_DC); - /** {{{ yaf_config_ini_modified */ static int yaf_config_ini_modified(zval * file, long ctime TSRMLS_DC) { diff --git a/yaf_controller.c b/yaf_controller.c index 8c92e1f4..8a09d5d6 100644 --- a/yaf_controller.c +++ b/yaf_controller.c @@ -21,10 +21,7 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_API.h" -#include "Zend/zend_interfaces.h" +#include "Zend/zend_interfaces.h" /* for zend_call_method_with_* */ #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c index 1a20c52f..6bd69784 100644 --- a/yaf_dispatcher.c +++ b/yaf_dispatcher.c @@ -21,10 +21,8 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_API.h" -#include "Zend/zend_interfaces.h" +#include "main/SAPI.h" /* for sapi_module */ +#include "Zend/zend_interfaces.h" /* for zend_call_method_with_* */ #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_exception.c b/yaf_exception.c index 5e11510a..c9b92b69 100644 --- a/yaf_exception.c +++ b/yaf_exception.c @@ -21,14 +21,7 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" #include "Zend/zend_exceptions.h" -#include "Zend/zend_alloc.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "zend_objects.h" #include "php_yaf.h" #include "yaf_application.h" diff --git a/yaf_loader.c b/yaf_loader.c index d6df1072..59cb602e 100644 --- a/yaf_loader.c +++ b/yaf_loader.c @@ -21,11 +21,7 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_alloc.h" -#include "ext/standard/php_smart_str.h" -#include "TSRM/tsrm_virtual_cwd.h" +#include "ext/standard/php_smart_str.h" /* for smart_str */ #include "php_yaf.h" #include "yaf_application.h" diff --git a/yaf_plugin.c b/yaf_plugin.c index e72fa344..34e82cd7 100644 --- a/yaf_plugin.c +++ b/yaf_plugin.c @@ -21,14 +21,6 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_alloc.h" -#include "ext/standard/info.h" -#include "ext/standard/php_string.h" -#include "zend_objects.h" #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_registry.c b/yaf_registry.c index 146fad10..d4752aa0 100644 --- a/yaf_registry.c +++ b/yaf_registry.c @@ -21,8 +21,6 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" #include "php_yaf.h" #include "yaf_namespace.h" diff --git a/yaf_request.c b/yaf_request.c index f8dd328a..df02ae8a 100644 --- a/yaf_request.c +++ b/yaf_request.c @@ -21,20 +21,15 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_alloc.h" -#include "ext/standard/php_string.h" +#include "Zend/zend_exceptions.h" /* for zend_exception_get_default */ #include "php_yaf.h" #include "yaf_request.h" #include "yaf_namespace.h" #include "yaf_exception.h" -#include "requests/simple.c" -#include "requests/http.c" +#include "requests/simple.h" +#include "requests/http.h" zend_class_entry *yaf_request_ce; diff --git a/yaf_response.c b/yaf_response.c index b4a7f8cc..cf560eea 100644 --- a/yaf_response.c +++ b/yaf_response.c @@ -21,8 +21,7 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" +#include "main/SAPI.h" /* for sapi_header_line */ #include "ext/standard/php_string.h" /* for php_implode */ #include "Zend/zend_interfaces.h" @@ -31,6 +30,9 @@ #include "yaf_response.h" #include "yaf_exception.h" +#include "response/http.h" +#include "response/cli.h" + zend_class_entry *yaf_response_ce; /** {{{ ARG_INFO @@ -62,9 +64,6 @@ ZEND_BEGIN_ARG_INFO_EX(yaf_response_set_header_arginfo, 0, 0, 2) ZEND_END_ARG_INFO() /* }}} */ -#include "response/http.c" -#include "response/cli.c" - /** {{{ yaf_response_t * yaf_response_instance(yaf_response_t *this_ptr, char *sapi_name TSRMLS_DC) */ yaf_response_t * yaf_response_instance(yaf_response_t *this_ptr, char *sapi_name TSRMLS_DC) { diff --git a/yaf_response.h b/yaf_response.h index 56cfec1e..8f2a2692 100644 --- a/yaf_response.h +++ b/yaf_response.h @@ -43,3 +43,12 @@ int yaf_response_clear_body(yaf_response_t *response, char *name, uint name_len YAF_STARTUP_FUNCTION(response); #endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/yaf_router.c b/yaf_router.c index 92e64699..a148f4d0 100644 --- a/yaf_router.c +++ b/yaf_router.c @@ -34,7 +34,14 @@ #include "yaf_request.h" #include "yaf_router.h" #include "yaf_config.h" -#include "routes/interface.c" + +#include "routes/interface.h" +#include "routes/static.h" +#include "routes/simple.h" +#include "routes/supervar.h" +#include "routes/regex.h" +#include "routes/rewrite.h" +#include "routes/map.h" zend_class_entry *yaf_router_ce; @@ -372,6 +379,12 @@ YAF_STARTUP_FUNCTION(router) { zend_declare_property_null(yaf_router_ce, ZEND_STRL(YAF_ROUTER_PROPERTY_NAME_CURRENT_ROUTE), ZEND_ACC_PROTECTED TSRMLS_CC); YAF_STARTUP(route); + YAF_STARTUP(route_static); + YAF_STARTUP(route_simple); + YAF_STARTUP(route_supervar); + YAF_STARTUP(route_rewrite); + YAF_STARTUP(route_regex); + YAF_STARTUP(route_map); return SUCCESS; } diff --git a/yaf_session.c b/yaf_session.c index 85a6093a..2bc80b28 100644 --- a/yaf_session.c +++ b/yaf_session.c @@ -21,10 +21,7 @@ #endif #include "php.h" -#include "php_ini.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_objects.h" -#include "main/SAPI.h" +#include "Zend/zend_interfaces.h" /* for zend_ce_iterator */ #include "php_yaf.h" #include "yaf_namespace.h" @@ -32,6 +29,7 @@ #include "yaf_exception.h" zend_class_entry * yaf_session_ce; + #ifdef HAVE_SPL extern PHPAPI zend_class_entry * spl_ce_Countable; #endif diff --git a/yaf_view.c b/yaf_view.c index fc3e8039..4ccc4e63 100644 --- a/yaf_view.c +++ b/yaf_view.c @@ -21,11 +21,6 @@ #endif #include "php.h" -#include "php_ini.h" -#include "main/SAPI.h" -#include "Zend/zend_interfaces.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_alloc.h" #include "php_yaf.h" #include "yaf_namespace.h" @@ -33,8 +28,8 @@ #include "yaf_loader.h" #include "yaf_view.h" -#include "views/interface.c" -#include "views/simple.c" +#include "views/interface.h" +#include "views/simple.h" #if 0 static yaf_view_struct yaf_buildin_views[] = {