Skip to content

Commit

Permalink
Merge pull request laruence#83 from remicollet/issue-230
Browse files Browse the repository at this point in the history
Various fix for 2.3.0
  • Loading branch information
laruence committed Jan 8, 2014
2 parents d164bda + 3a1f02e commit b9e8791
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 17 deletions.
6 changes: 6 additions & 0 deletions check-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

for src in *.c */*.c *.h */*.h tests/*phpt tests/*ini
do
grep -q $(basename $src) package.xml || echo "Missing $src"
done
5 changes: 2 additions & 3 deletions configs/yaf_config_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ZEND_END_ARG_INFO()

/** {{{ static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC)
*/
static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) {
static inline void yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) {
zval **ppzval, **dstppzval, *value;
HashTable *ht;
ulong idx;
Expand Down Expand Up @@ -125,8 +125,7 @@ static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) {
/** {{{ zval * yaf_config_ini_format(yaf_config_t *instance, zval **ppzval TSRMLS_DC)
*/
zval * yaf_config_ini_format(yaf_config_t *instance, zval **ppzval TSRMLS_DC) {
zval *readonly, *ret;
readonly = zend_read_property(yaf_config_ini_ce, instance, ZEND_STRL(YAF_CONFIG_PROPERT_NAME_READONLY), 1 TSRMLS_CC);
zval *ret;
ret = yaf_config_ini_instance(NULL, *ppzval, NULL TSRMLS_CC);
return ret;
}
Expand Down
17 changes: 17 additions & 0 deletions package2.xml → package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,47 @@
<file name="yaf_view.h" role="src" />
<dir name="configs">
<file name="yaf_config_ini.c" role="src" />
<file name="yaf_config_ini.h" role="src" />
<file name="yaf_config_simple.c" role="src" />
<file name="yaf_config_simple.h" role="src" />
</dir>
<file name="config.w32" role="src" />
<file name="LICENSE" role="doc" />
<file name="CREDITS" role="doc" />
<file name="php_yaf.h" role="src" />
<dir name="requests">
<file name="yaf_request_http.c" role="src" />
<file name="yaf_request_http.h" role="src" />
<file name="yaf_request_simple.c" role="src" />
<file name="yaf_request_simple.h" role="src" />
</dir>
<dir name="responses">
<file name="yaf_response_http.c" role="src" />
<file name="yaf_response_http.h" role="src" />
<file name="yaf_response_cli.c" role="src" />
<file name="yaf_response_cli.h" role="src" />
</dir>
<dir name="routes">
<file name="yaf_route_interface.c" role="src" />
<file name="yaf_route_interface.h" role="src" />
<file name="yaf_route_rewrite.c" role="src" />
<file name="yaf_route_rewrite.h" role="src" />
<file name="yaf_route_supervar.c" role="src" />
<file name="yaf_route_supervar.h" role="src" />
<file name="yaf_route_static.c" role="src" />
<file name="yaf_route_static.h" role="src" />
<file name="yaf_route_simple.c" role="src" />
<file name="yaf_route_simple.h" role="src" />
<file name="yaf_route_regex.c" role="src" />
<file name="yaf_route_regex.h" role="src" />
<file name="yaf_route_map.c" role="src" />
<file name="yaf_route_map.h" role="src" />
</dir>
<dir name="views">
<file name="yaf_view_interface.c" role="src" />
<file name="yaf_view_interface.h" role="src" />
<file name="yaf_view_simple.c" role="src" />
<file name="yaf_view_simple.h" role="src" />
</dir>
<dir name="tests">
<file name="001.phpt" role="test" />
Expand Down Expand Up @@ -177,8 +192,10 @@
<file name="bug63381.phpt" role="test" />
<file name="bug63438.phpt" role="test" />
<file name="bug63900.phpt" role="test" />
<file name="bug62702.phpt" role="test" />
<file name="simple.ini" role="test" />
<file name="system.ini" role="test" />
<file name="multi-section.ini" role="test" />
</dir>
</dir>
</contents>
Expand Down
2 changes: 1 addition & 1 deletion responses/yaf_response_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int yaf_response_http_send(yaf_response_t *response TSRMLS_DC) {
if (zend_hash_get_current_key_ex(Z_ARRVAL_P(zheader), &header_name, &header_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING) {
ctr.line_len = spprintf(&(ctr.line), 0, "%s: %s", header_name, Z_STRVAL_PP(entry));
} else {
ctr.line_len = spprintf(&(ctr.line), 0, "%s: %s", num_key, Z_STRVAL_PP(entry));
ctr.line_len = spprintf(&(ctr.line), 0, "%lu: %s", num_key, Z_STRVAL_PP(entry));
}

ctr.response_code = 0;
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ zval * yaf_route_map_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query TSRM
efree(pname);

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type, key_len, i = 0;
uint key_len, i = 0;
char *key;
ulong key_idx;
zval **tmp_data;
Expand Down Expand Up @@ -277,7 +277,7 @@ PHP_METHOD(yaf_route_map, assemble) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) {
return;
} else {
if (return_uri = yaf_route_map_assemble(getThis(), mvc, query TSRMLS_CC)) {
if ((return_uri = yaf_route_map_assemble(getThis(), mvc, query TSRMLS_CC))) {
RETURN_ZVAL(return_uri, 0, 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ zval * yaf_route_regex_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query TS
}

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type, key_len;
uint key_len;
char *key;
ulong key_idx;
HashTable *ht = Z_ARRVAL_P(query);
Expand Down Expand Up @@ -364,7 +364,7 @@ PHP_METHOD(yaf_route_regex, assemble) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) {
return;
} else {
if (return_uri = yaf_route_regex_assemble(getThis(), mvc, query TSRMLS_CC)) {
if ((return_uri = yaf_route_regex_assemble(getThis(), mvc, query TSRMLS_CC))) {
RETURN_ZVAL(return_uri, 0, 1);
}
}
Expand Down
3 changes: 1 addition & 2 deletions routes/yaf_route_rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ PHP_METHOD(yaf_route_rewrite, route) {
/** {{{ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *query TSRMLS_DC)
*/
zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *query TSRMLS_DC) {
zval *reverse, *uri, *match, *pidents;
zval *uri, *match, *pidents;
zval **tmp;
char *tstr, *inter, *seg, *pmatch, *ptrptr, *key;
int tlen;
Expand Down Expand Up @@ -331,7 +331,6 @@ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *que
zval_ptr_dtor(&pidents);

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type;
HashTable *ht = Z_ARRVAL_P(query);

smart_str_appendc(&squery, '?');
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ zval * yaf_route_simple_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query T
smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type, key_len;
uint key_len;
char *key;
ulong key_idx;

Expand Down Expand Up @@ -212,7 +212,7 @@ PHP_METHOD(yaf_route_simple, assemble) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) {
return;
} else {
if (return_uri = yaf_route_simple_assemble(getThis(), mvc, query TSRMLS_CC)) {
if ((return_uri = yaf_route_simple_assemble(getThis(), mvc, query TSRMLS_CC))) {
RETURN_ZVAL(return_uri, 0, 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ zval * yaf_route_static_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query T
smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type, key_len;
uint key_len;
char *key;
ulong key_idx;
int start = 0, end = 0;
Expand Down Expand Up @@ -281,7 +281,7 @@ PHP_METHOD(yaf_route_static, assemble) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) {
return;
} else {
if (return_uri = yaf_route_static_assemble(getThis(), mvc, query TSRMLS_CC)) {
if ((return_uri = yaf_route_static_assemble(getThis(), mvc, query TSRMLS_CC))) {
RETURN_ZVAL(return_uri, 0, 1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions routes/yaf_route_supervar.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ zval * yaf_route_supervar_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query
smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));

if (IS_ARRAY == Z_TYPE_P(query)) {
uint key_type, key_len;
uint key_len;
char *key;
ulong key_idx;

Expand Down Expand Up @@ -197,7 +197,7 @@ PHP_METHOD(yaf_route_supervar, assemble) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) {
return;
} else {
if (return_uri = yaf_route_supervar_assemble(getThis(), mvc, query TSRMLS_CC)) {
if ((return_uri = yaf_route_supervar_assemble(getThis(), mvc, query TSRMLS_CC))) {
RETURN_ZVAL(return_uri, 0, 1);
}
}
Expand Down
4 changes: 3 additions & 1 deletion yaf_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,
} else {
int is_def_module = 0;
/* int is_def_ctr = 0; */
zval *module, *controller, *dmodule, *dcontroller, *instantly_flush;
zval *module, *controller, *dmodule, /* *dcontroller,*/ *instantly_flush;
zend_class_entry *ce;
yaf_controller_t *executor;
zend_function *fptr;
Expand All @@ -544,7 +544,9 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,
controller = zend_read_property(request_ce, request, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_CONTROLLER), 1 TSRMLS_CC);

dmodule = zend_read_property(yaf_dispatcher_ce, dispatcher, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_MODULE), 1 TSRMLS_CC);
/*
dcontroller = zend_read_property(yaf_dispatcher_ce, dispatcher, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_CONTROLLER), 1 TSRMLS_CC);
*/

if (Z_TYPE_P(module) != IS_STRING
|| !Z_STRLEN_P(module)) {
Expand Down

0 comments on commit b9e8791

Please sign in to comment.