keep php class and php_extention return data key same, we change php_extension return data key : cityId to city_id

This commit is contained in:
dongyado 2018-06-27 10:44:29 +08:00
parent 35cc0f37c7
commit 550425a2b5
3 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@ META-INF/
# vim swp file #
*.swp
.idea
# binding
/binding/java/classes/

View File

@ -67,10 +67,10 @@ void search(
if ( res == 1 )
{
add_assoc_long( *return_value, "cityId", (*_block).city_id);
add_assoc_long( *return_value, "city_id", (*_block).city_id);
add_assoc_string( *return_value, "region", (*_block).region, 1);
} else {
add_assoc_long( *return_value, "cityId", 0);
add_assoc_long( *return_value, "city_id", 0);
add_assoc_string( *return_value, "region", "[Error] Search Failed! Please check the path of ip2region db file.", 1);
}
}

View File

@ -67,12 +67,12 @@ void search(
if ( res == 1 )
{
add_assoc_long( *return_value, "cityId", (*_block).city_id);
add_assoc_long( *return_value, "city_id", (*_block).city_id);
//add_assoc_string( *return_value, "region", (*_block).region, 1);
// for phpng
add_assoc_string( *return_value, "region", (*_block).region);
} else {
add_assoc_long( *return_value, "cityId", 0);
add_assoc_long( *return_value, "city_id", 0);
//add_assoc_string( *return_value, "region", "[Error] Search Failed! Please check the path of ip2region db file.", 1);
// for phpng
add_assoc_string( *return_value, "region", "[Error] Search Failed! Please check the path of ip2region db file.");