mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 01:57:13 +00:00
Initial skeleton of extension (#2)
* Added .gitignore * Added initial attempt at autoconf config * Skeleton C source
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
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)
|
||||
PHP_INI_END()
|
||||
|
||||
static PHP_MINIT_FUNCTION(awscrt)
|
||||
{
|
||||
REGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static PHP_MSHUTDOWN_FUNCTION(awscrt)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static PHP_GINIT_FUNCTION(awscrt)
|
||||
{
|
||||
#if defined(COMPILE_DL_ASTKIT) && defined(ZTS)
|
||||
ZEND_TSRMLS_CACHE_UPDATE();
|
||||
#endif
|
||||
awscrt_globals->log_level = 0;
|
||||
}
|
||||
|
||||
zend_module_entry awscrt_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"awscrt",
|
||||
NULL, /* functions */
|
||||
PHP_MINIT(awscrt),
|
||||
PHP_MSHUTDOWN(awscrt),
|
||||
NULL, /* RINIT */
|
||||
NULL, /* RSHUTDOWN */
|
||||
NULL, /* MINFO */
|
||||
NO_VERSION_YET,
|
||||
PHP_MODULE_GLOBALS(awscrt),
|
||||
PHP_GINIT(awscrt),
|
||||
NULL, /* GSHUTDOWN */
|
||||
NULL, /* RPOSTSHUTDOWN */
|
||||
STANDARD_MODULE_PROPERTIES_EX};
|
||||
|
||||
#ifdef COMPILE_DL_AWSCRT
|
||||
ZEND_GET_MODULE(awscrt)
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
#ifndef PHP_AWS_CRT_H
|
||||
#define PHP_AWS_CRT_H
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
|
||||
long log_level;
|
||||
ZEND_END_MODULE_GLOBALS(awscrt)
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(awscrt)
|
||||
|
||||
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
|
||||
|
||||
#endif /* PHP_AWS_CRT_H */
|
||||
Reference in New Issue
Block a user