Skip to content

Commit

Permalink
mark release as stable and updates php requirement (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK authored Mar 16, 2023
1 parent c4ea24d commit ed3f8ca
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dev-scripts/package.xml-template_post
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<dependencies>
<required>
<php>
<min>7.4.0</min>
<min>5.5.0</min>
</php>
<pearinstaller>
<min>1.10.0</min>
Expand Down
2 changes: 1 addition & 1 deletion dev-scripts/package.xml-template_pre
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<api>1.0.0</api>
</version>
<stability>
<release>devel</release>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="https://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</license>
Expand Down
16 changes: 11 additions & 5 deletions dev-scripts/prepare_pecl_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@ def run(args):

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)


Expand Down
4 changes: 1 addition & 3 deletions ext/crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 */
Expand Down
18 changes: 10 additions & 8 deletions ext/php_aws_crt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand Down

0 comments on commit ed3f8ca

Please sign in to comment.