Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Feb 11, 2015
1 parent 7de2169 commit 28b96b4
Show file tree
Hide file tree
Showing 40 changed files with 130 additions and 472 deletions.
4 changes: 1 addition & 3 deletions configs/yaf_config_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_config.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_CONFIG_INI_H
#define YAF_CONFIG_INI_H

Expand All @@ -25,7 +23,7 @@

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_config_t *yaf_config_ini_instance(yaf_config_t *this_ptr, zval *filename, zval *section);

YAF_STARTUP_FUNCTION(config_ini);

Expand Down
5 changes: 2 additions & 3 deletions configs/yaf_config_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
+----------------------------------------------------------------------+
*/

/* $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_config_t * yaf_config_simple_instance(yaf_config_t *this_ptr, zval *values, zval *readonly);

YAF_STARTUP_FUNCTION(config_simple);

#endif

/*
* Local variables:
* tab-width: 4
Expand Down
7 changes: 3 additions & 4 deletions php_yaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: php_yaf.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef PHP_YAF_H
#define PHP_YAF_H

Expand Down Expand Up @@ -77,8 +75,8 @@ extern zend_module_entry yaf_module_entry;

#define YAF_ME(c, m, a, f) {m, PHP_MN(c), a, (uint) (sizeof(a)/sizeof(struct _zend_arg_info)-1), f},

extern PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
extern PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC);
extern PHPAPI void php_var_dump(zval **struc, int level);
extern PHPAPI void php_debug_zval_dump(zval **struc, int level);

ZEND_BEGIN_MODULE_GLOBALS(yaf)
zend_string *ext;
Expand Down Expand Up @@ -136,6 +134,7 @@ PHP_MINFO_FUNCTION(yaf);
extern ZEND_DECLARE_MODULE_GLOBALS(yaf);

#endif

/*
* Local variables:
* tab-width: 4
Expand Down
5 changes: 2 additions & 3 deletions requests/yaf_request_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
+----------------------------------------------------------------------+
*/

/* $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_request_t * yaf_request_simple_instance(yaf_request_t *this_ptr, zval *module, zval *controller, zval *action, zval *method, zval *params);
YAF_STARTUP_FUNCTION(request_simple);

#endif

/*
* Local variables:
* tab-width: 4
Expand Down
4 changes: 1 addition & 3 deletions responses/yaf_response_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: cli.c 329197 2013-01-18 05:55:37Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -45,7 +43,7 @@ YAF_STARTUP_FUNCTION(response_cli) {

YAF_INIT_CLASS_ENTRY(ce, "Yaf_Response_Cli", "Yaf\\Response\\Cli", yaf_response_cli_methods);

yaf_response_cli_ce = zend_register_internal_class_ex(&ce, yaf_response_ce TSRMLS_CC);
yaf_response_cli_ce = zend_register_internal_class_ex(&ce, yaf_response_ce);

return SUCCESS;
}
Expand Down
2 changes: 0 additions & 2 deletions responses/yaf_response_cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_response.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef PHP_YAF_RESPONSE_CLI_H
#define PHP_YAF_RESPONSE_CLI_H

Expand Down
2 changes: 0 additions & 2 deletions responses/yaf_response_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: http.c 329197 2013-01-18 05:55:37Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down
18 changes: 8 additions & 10 deletions routes/yaf_route_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: interface.c 329197 2013-01-18 05:55:37Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand All @@ -38,9 +36,9 @@

zend_class_entry *yaf_route_ce;

/* {{{ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC)
/* {{{ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config)
*/
yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC) {
yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config) {
zval *match, *def, *map, *verify, *reverse, *pzval;
yaf_route_t *instance = NULL;

Expand Down Expand Up @@ -68,7 +66,7 @@ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC)
verify = NULL;
}

instance = yaf_route_rewrite_instance(this_ptr, match, def, verify? verify : NULL TSRMLS_CC);
instance = yaf_route_rewrite_instance(this_ptr, match, def, verify? verify : NULL);
} else if (Z_STRLEN_P(pzval) == (sizeof("regex") - 1)
&& strncasecmp(Z_STRVAL_P(pzval), "regex", sizeof("regex") - 1) == 0) {
if ((match = zend_hash_str_find(Z_ARRVAL_P(config), ZEND_STRL("match"))) == NULL || Z_TYPE_P(match) != IS_STRING) {
Expand All @@ -90,7 +88,7 @@ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC)
reverse = NULL;
}

instance = yaf_route_regex_instance(this_ptr, match, def, map? map : NULL, verify? verify : NULL, reverse? reverse : NULL TSRMLS_CC);
instance = yaf_route_regex_instance(this_ptr, match, def, map? map : NULL, verify? verify : NULL, reverse? reverse : NULL);
} else if (Z_STRLEN_P(pzval) == (sizeof("map") - 1)
&& strncasecmp(Z_STRVAL_P(pzval), "map", sizeof("map") - 1) == 0) {
char *delimiter = NULL;
Expand All @@ -111,7 +109,7 @@ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC)
delim_len = Z_STRLEN_P(pzval);
}

instance = yaf_route_map_instance(this_ptr, controller_prefer, delimiter, delim_len TSRMLS_CC);
instance = yaf_route_map_instance(this_ptr, controller_prefer, delimiter, delim_len);
} else if (Z_STRLEN_P(pzval) == (sizeof("simple") - 1)
&& strncasecmp(Z_STRVAL_P(pzval), "simple", sizeof("simple") - 1) == 0) {
if ((match = zend_hash_str_find(Z_ARRVAL_P(config), ZEND_STRL("module"))) == NULL
Expand All @@ -127,15 +125,15 @@ yaf_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config TSRMLS_DC)
return NULL;
}

instance = yaf_route_simple_instance(this_ptr, match, def, map TSRMLS_CC);
instance = yaf_route_simple_instance(this_ptr, match, def, map);
} else if (Z_STRLEN_P(pzval) == (sizeof("supervar") - 1)
&& strncasecmp(Z_STRVAL_P(pzval), "supervar", sizeof("supervar") - 1) == 0) {
if ((match = zend_hash_str_find(Z_ARRVAL_P(config), ZEND_STRL("varname"))) == NULL
|| Z_TYPE_P(match) != IS_STRING) {
return NULL;
}

instance = yaf_route_supervar_instance(this_ptr, match TSRMLS_CC);
instance = yaf_route_supervar_instance(this_ptr, match);
}

return instance;
Expand All @@ -157,7 +155,7 @@ 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_route_ce = zend_register_internal_interface(&ce);

return SUCCESS;
}
Expand Down
4 changes: 1 addition & 3 deletions routes/yaf_route_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_ROUTER_INTERFACE_H
#define YAF_ROUTER_INTERFACE_H

Expand Down Expand Up @@ -44,7 +42,7 @@ 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_route_t * yaf_route_instance(yaf_route_t *this_ptr, zval *config);

YAF_STARTUP_FUNCTION(route);

Expand Down
8 changes: 3 additions & 5 deletions routes/yaf_route_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
+----------------------------------------------------------------------+
*/

/* $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 "_delimiter"
#define YAF_ROUTE_MAP_VAR_NAME_CTL_PREFER "_ctl_router"
#define YAF_ROUTE_MAP_VAR_NAME_DELIMETER "_delimiter"
#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_route_t *yaf_route_map_instance(yaf_route_t *this_ptr, zend_bool controller_prefer, char *delim, uint len);

YAF_STARTUP_FUNCTION(route_map);

Expand Down
4 changes: 1 addition & 3 deletions routes/yaf_route_regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
+----------------------------------------------------------------------+
*/

/* $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, zval *reverse TSRMLS_DC);
yaf_route_t *yaf_route_regex_instance(yaf_route_t *this_ptr, zval *route, zval *def, zval *map, zval *verify, zval *reverse);

YAF_STARTUP_FUNCTION(route_regex);

Expand Down
4 changes: 1 addition & 3 deletions routes/yaf_route_rewrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
+----------------------------------------------------------------------+
*/

/* $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_route_t * yaf_route_rewrite_instance(yaf_route_t *this_ptr, zval *match, zval *router, zval *verify);

YAF_STARTUP_FUNCTION(route_rewrite);

Expand Down
4 changes: 1 addition & 3 deletions routes/yaf_route_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_router.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_ROUTER_SIMPLE_H
#define YAF_ROUTER_SIMPLE_H

Expand All @@ -25,7 +23,7 @@

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_route_t *yaf_route_simple_instance(yaf_route_t *this_ptr, zval *module, zval *controller, zval *action);

YAF_STARTUP_FUNCTION(route_simple);

Expand Down
4 changes: 1 addition & 3 deletions routes/yaf_route_supervar.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
+----------------------------------------------------------------------+
*/

/* $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_route_t *yaf_route_supervar_instance(yaf_route_t *this_ptr, zval *name);

YAF_STARTUP_FUNCTION(route_supervar);

Expand Down
4 changes: 1 addition & 3 deletions views/yaf_view_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: interface.c 329197 2013-01-18 05:55:37Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -49,7 +47,7 @@ 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);
yaf_view_interface_ce = zend_register_internal_interface(&ce TSRMLS_CC);
yaf_view_interface_ce = zend_register_internal_interface(&ce);

return SUCCESS;
}
Expand Down
2 changes: 0 additions & 2 deletions views/yaf_view_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_view.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_VIEW_INTERFACE_H
#define YAF_VIEW_INTERFACE_H

Expand Down
2 changes: 0 additions & 2 deletions views/yaf_view_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_view.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_VIEW_SIMPLE_H
#define YAF_VIEW_SIMPLE_H

Expand Down
4 changes: 0 additions & 4 deletions yaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ PHP_MINIT_FUNCTION(yaf)
{
REGISTER_INI_ENTRIES();

#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 5
php_register_info_logo(YAF_LOGO_GUID, YAF_LOGO_MIME_TYPE, yaf_logo, sizeof(yaf_logo));
#endif

#ifdef YAF_HAVE_NAMESPACE
if (YAF_G(use_namespace)) {

Expand Down
4 changes: 1 addition & 3 deletions yaf_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_bootstrap.c 329197 2013-01-18 05:55:37Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand All @@ -41,7 +39,7 @@ YAF_STARTUP_FUNCTION(bootstrap) {
zend_class_entry ce;

YAF_INIT_CLASS_ENTRY(ce, "Yaf_Bootstrap_Abstract", "Yaf\\Bootstrap_Abstract", yaf_bootstrap_methods);
yaf_bootstrap_ce = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
yaf_bootstrap_ce = zend_register_internal_class_ex(&ce, NULL);
yaf_bootstrap_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;

return SUCCESS;
Expand Down
2 changes: 0 additions & 2 deletions yaf_bootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_bootstrap.h 329002 2013-01-07 12:55:53Z laruence $ */

#ifndef YAF_BOOTSTRAP_H
#define YAF_BOOTSTRAP_H

Expand Down
4 changes: 0 additions & 4 deletions yaf_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_config.c 329200 2013-01-18 06:26:40Z laruence $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -279,8 +277,6 @@ static void yaf_config_ini_serialize(yaf_config_t *this_ptr, zval *filename, zva
}
/* }}} */

/** {{{ yaf_config_t * yaf_config_instance(yaf_config_t *this_ptr, zval *arg1, zval *arg2)
*/
yaf_config_t *yaf_config_instance(yaf_config_t *this_ptr, zval *arg1, zval *arg2) /* {{{ */ {
yaf_config_t *instance;

Expand Down
Loading

0 comments on commit 28b96b4

Please sign in to comment.