Updated CRT library, test process, EventLoopGroup API updates (#16)

* Updated to latest aws-crt-ffi, updated EventLoopGroup/options init

* Removed test-ci target, just use test for everything now

* Added event_loop_group API to CRT/stubs

* Removed headers (all generated) from format-check

* Added the ability to force extension vs FFI

* make test will now trigger composer run test/phpunit, and force tests with both FFI and extension

* Updated builder version, removed redundant php7 test run

* Removed type annotations that anger php5, limited backends on php5
This commit is contained in:
Justin Boswell
2021-03-12 11:47:55 -08:00
committed by GitHub
parent ec7900afb5
commit 9171857448
13 changed files with 237 additions and 175 deletions
+32 -3
View File
@@ -81,14 +81,43 @@ PHP_FUNCTION(aws_crt_error_debug_str) {
AWS_RETURN_STRING(aws_crt_error_debug_str(error_code));
}
PHP_FUNCTION(aws_crt_event_loop_group_new) {
PHP_FUNCTION(aws_crt_event_loop_group_options_new) {
aws_crt_event_loop_group_options *options = aws_crt_event_loop_group_options_new();
RETURN_LONG((zend_ulong)options);
}
PHP_FUNCTION(aws_crt_event_loop_group_options_release) {
zend_ulong php_options = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &php_options) == FAILURE) {
return;
}
aws_crt_event_loop_group_options *options = (void *)php_options;
aws_crt_event_loop_group_options_release(options);
}
PHP_FUNCTION(aws_crt_event_loop_group_options_set_max_threads) {
zend_ulong php_options = 0;
zend_ulong num_threads = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num_threads) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &php_options, &num_threads) == FAILURE) {
RETURN_NULL();
}
struct aws_event_loop_group *elg = aws_crt_event_loop_group_new(num_threads);
aws_crt_event_loop_group_options *options = (void *)php_options;
aws_crt_event_loop_group_options_set_max_threads(options, num_threads);
}
PHP_FUNCTION(aws_crt_event_loop_group_new) {
zend_ulong php_options = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &php_options) == FAILURE) {
RETURN_NULL();
}
aws_crt_event_loop_group_options *options = (void *)php_options;
struct aws_event_loop_group *elg = aws_crt_event_loop_group_new(options);
RETURN_LONG((zend_ulong)elg);
}