diff --git a/dev-scripts/package.xml-template_post b/dev-scripts/package.xml-template_post index 2506f9d..03b7b4a 100644 --- a/dev-scripts/package.xml-template_post +++ b/dev-scripts/package.xml-template_post @@ -2,7 +2,7 @@ - 7.4.0 + 5.5.0 1.10.0 diff --git a/dev-scripts/package.xml-template_pre b/dev-scripts/package.xml-template_pre index 53c7d5b..c5fc519 100644 --- a/dev-scripts/package.xml-template_pre +++ b/dev-scripts/package.xml-template_pre @@ -16,7 +16,7 @@ 1.0.0 - devel + stable stable Apache License Version 2.0 diff --git a/dev-scripts/prepare_pecl_release.py b/dev-scripts/prepare_pecl_release.py index 8f8b919..3da45d9 100644 --- a/dev-scripts/prepare_pecl_release.py +++ b/dev-scripts/prepare_pecl_release.py @@ -47,14 +47,20 @@ os.chdir(WORK_DIR) run(['git', 'submodule', 'update', '--init', '--recursive']) -# replace the version number in the ext/crt.c file +# replace the version number in the file_with_version data = "" -with open("ext/crt.c", "r") as c_file: +file_with_version = "ext/php_aws_crt.h" +with open(file_with_version, "r") as c_file: for line in c_file: - line = re.sub("#define CRT_VERSION .*", - f"#define CRT_VERSION \"{VERSION}\"", line) + if "define PHP_AWSCRT_VERSION" in line: + line = re.sub("define PHP_AWSCRT_VERSION .*", + f"define PHP_AWSCRT_VERSION \"{VERSION}\"", line) + if VERSION not in line: + sys.exit( + f"check {file_with_version}, the version number was not updated correctly.") data += line -with open("ext/crt.c", "w") as c_file: + +with open(file_with_version, "w") as c_file: c_file.write(data) diff --git a/ext/crt.c b/ext/crt.c index 3202abe..0099efc 100644 --- a/ext/crt.c +++ b/ext/crt.c @@ -263,8 +263,6 @@ static PHP_GINIT_FUNCTION(awscrt) { awscrt_globals->log_level = 0; } -#define CRT_VERSION "1.0.4" - zend_module_entry awscrt_module_entry = { STANDARD_MODULE_HEADER, "awscrt", @@ -274,7 +272,7 @@ zend_module_entry awscrt_module_entry = { NULL, /* RINIT */ NULL, /* RSHUTDOWN */ NULL, /* MINFO */ - CRT_VERSION, + PHP_AWSCRT_VERSION, PHP_MODULE_GLOBALS(awscrt), PHP_GINIT(awscrt), NULL, /* GSHUTDOWN */ diff --git a/ext/php_aws_crt.h b/ext/php_aws_crt.h index 9393a0b..68951c1 100644 --- a/ext/php_aws_crt.h +++ b/ext/php_aws_crt.h @@ -37,6 +37,8 @@ #define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0) #define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2) +#define PHP_AWSCRT_VERSION "1.1.0" + ZEND_BEGIN_MODULE_GLOBALS(awscrt) long log_level; ZEND_END_MODULE_GLOBALS(awscrt) @@ -48,16 +50,16 @@ ZEND_EXTERN_MODULE_GLOBALS(awscrt) #if AWS_PHP_AT_LEAST_7 /* PHP 7 takes a zval*, PHP5 takes a zval** */ # define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z) -#define XRETURN_STRINGL RETURN_STRINGL -#define XRETURN_STRING RETURN_STRING -#define XRETVAL_STRINGL RETVAL_STRINGL -#define XRETVAL_STRING RETVAL_STRING +# define XRETURN_STRINGL RETURN_STRINGL +# define XRETURN_STRING RETURN_STRING +# define XRETVAL_STRINGL RETVAL_STRINGL +# define XRETVAL_STRING RETVAL_STRING #else /* PHP 5.5-5.6 */ # define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z) -#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1) -#define XRETURN_STRING(s) RETURN_STRING(s, 1) -#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1) -#define XRETVAL_STRING(s) RETVAL_STRING(s, 1) +# define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1) +# define XRETURN_STRING(s) RETURN_STRING(s, 1) +# define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1) +# define XRETVAL_STRING(s) RETVAL_STRING(s, 1) #endif /* PHP 5.x */ #include "api.h"