mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 01:57:13 +00:00
Added test-ffi target, use it in CI (#9)
* Added test-ffi target, use it in CI * Added clang-format config, fixed RETURN_STRING API mismatch * Skip installing php and packages on the PHP docker images * Removed al2 job that was never going to work, and compiler tests * Fixed basic test for extension loading * Cleaned up lib structure, fixed tests * use test-ci target to conditionally test in GitHub * Use v0.8.1 of builder
This commit is contained in:
@@ -9,34 +9,40 @@
|
||||
ZEND_DECLARE_MODULE_GLOBALS(awscrt);
|
||||
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("awscrt.log_level", "", PHP_INI_ALL, OnUpdateLongGEZero,
|
||||
log_level, zend_awscrt_globals, awscrt_globals)
|
||||
STD_PHP_INI_ENTRY(
|
||||
"awscrt.log_level",
|
||||
"",
|
||||
PHP_INI_ALL,
|
||||
OnUpdateLongGEZero,
|
||||
log_level,
|
||||
zend_awscrt_globals,
|
||||
awscrt_globals)
|
||||
PHP_INI_END()
|
||||
|
||||
static PHP_MINIT_FUNCTION(awscrt) {
|
||||
REGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
REGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static PHP_MSHUTDOWN_FUNCTION(awscrt) {
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static PHP_GINIT_FUNCTION(awscrt) {
|
||||
#if defined(COMPILE_DL_ASTKIT) && defined(ZTS)
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
awscrt_globals->log_level = 0;
|
||||
awscrt_globals->log_level = 0;
|
||||
}
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(awscrt_version_arginfo, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
PHP_FUNCTION(awscrt_version) {
|
||||
static const char *version = "1.0.0-dev";
|
||||
RETURN_STRING(version, 0);
|
||||
static const char *version = "1.0.0-dev";
|
||||
AWS_RETURN_STRING(version);
|
||||
}
|
||||
/* clang-format off */
|
||||
const zend_function_entry awscrt_functions[] = {
|
||||
|
||||
+16
-1
@@ -8,11 +8,19 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
|
||||
|
||||
#if ZEND_EXTENSION_API_NO < 220131226
|
||||
# error "PHP >= 5.6 is required"
|
||||
#endif
|
||||
|
||||
#define AWS_PHP_AT_LEAST_7 defined(ZEND_EXTENSION_API_NO_7_0_X) || (ZEND_EXTENSION_API_NO >= 320151012)
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
|
||||
long log_level;
|
||||
ZEND_END_MODULE_GLOBALS(awscrt)
|
||||
@@ -21,4 +29,11 @@ ZEND_EXTERN_MODULE_GLOBALS(awscrt)
|
||||
|
||||
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
|
||||
|
||||
/* PHP 7 removed the string duplicate parameter */
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
# define AWS_RETURN_STRING(s) RETURN_STRING(s)
|
||||
#else
|
||||
# define AWS_RETURN_STRING(s) RETURN_STRING(s, 1)
|
||||
#endif
|
||||
|
||||
#endif /* PHP_AWS_CRT_H */
|
||||
|
||||
Reference in New Issue
Block a user