-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO_NOT_MERGE: test #8
Open
zeriyoshi
wants to merge
2
commits into
main
Choose a base branch
from
pr_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
*.lo | ||
*.la | ||
.libs | ||
acinclude.m4 | ||
aclocal.m4 | ||
autom4te.cache | ||
build | ||
config.guess | ||
config.h | ||
config.h.in | ||
config.log | ||
config.nice | ||
config.status | ||
config.sub | ||
configure | ||
configure.ac | ||
configure.in | ||
include | ||
install-sh | ||
libtool | ||
ltmain.sh | ||
Makefile | ||
Makefile.fragments | ||
Makefile.global | ||
Makefile.objects | ||
missing | ||
mkinstalldirs | ||
modules | ||
php_test_results_*.txt | ||
phpt.* | ||
run-test-info.php | ||
run-tests.php | ||
tests/**/*.diff | ||
tests/**/*.out | ||
tests/**/*.php | ||
tests/**/*.exp | ||
tests/**/*.log | ||
tests/**/*.sh | ||
tests/**/*.db | ||
tests/**/*.mem | ||
tmp-php.ini |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
dnl config.m4 for extension conga | ||
|
||
dnl Comments in this file start with the string 'dnl'. | ||
dnl Remove where necessary. | ||
|
||
dnl If your extension references something external, use 'with': | ||
|
||
dnl PHP_ARG_WITH([conga], | ||
dnl [for conga support], | ||
dnl [AS_HELP_STRING([--with-conga], | ||
dnl [Include conga support])]) | ||
|
||
dnl Otherwise use 'enable': | ||
|
||
PHP_ARG_ENABLE([conga], | ||
[whether to enable conga support], | ||
[AS_HELP_STRING([--enable-conga], | ||
[Enable conga support])], | ||
[no]) | ||
|
||
if test "$PHP_CONGA" != "no"; then | ||
dnl Write more examples of tests here... | ||
|
||
dnl Remove this code block if the library does not support pkg-config. | ||
dnl PKG_CHECK_MODULES([LIBFOO], [foo]) | ||
dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS) | ||
dnl PHP_EVAL_LIBLINE($LIBFOO_LIBS, CONGA_SHARED_LIBADD) | ||
|
||
dnl If you need to check for a particular library version using PKG_CHECK_MODULES, | ||
dnl you can use comparison operators. For example: | ||
dnl PKG_CHECK_MODULES([LIBFOO], [foo >= 1.2.3]) | ||
dnl PKG_CHECK_MODULES([LIBFOO], [foo < 3.4]) | ||
dnl PKG_CHECK_MODULES([LIBFOO], [foo = 1.2.3]) | ||
|
||
dnl Remove this code block if the library supports pkg-config. | ||
dnl --with-conga -> check with-path | ||
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this | ||
dnl SEARCH_FOR="/include/conga.h" # you most likely want to change this | ||
dnl if test -r $PHP_CONGA/$SEARCH_FOR; then # path given as parameter | ||
dnl CONGA_DIR=$PHP_CONGA | ||
dnl else # search default path list | ||
dnl AC_MSG_CHECKING([for conga files in default path]) | ||
dnl for i in $SEARCH_PATH ; do | ||
dnl if test -r $i/$SEARCH_FOR; then | ||
dnl CONGA_DIR=$i | ||
dnl AC_MSG_RESULT(found in $i) | ||
dnl fi | ||
dnl done | ||
dnl fi | ||
dnl | ||
dnl if test -z "$CONGA_DIR"; then | ||
dnl AC_MSG_RESULT([not found]) | ||
dnl AC_MSG_ERROR([Please reinstall the conga distribution]) | ||
dnl fi | ||
|
||
dnl Remove this code block if the library supports pkg-config. | ||
dnl --with-conga -> add include path | ||
dnl PHP_ADD_INCLUDE($CONGA_DIR/include) | ||
|
||
dnl Remove this code block if the library supports pkg-config. | ||
dnl --with-conga -> check for lib and symbol presence | ||
dnl LIBNAME=CONGA # you may want to change this | ||
dnl LIBSYMBOL=CONGA # you most likely want to change this | ||
|
||
dnl If you need to check for a particular library function (e.g. a conditional | ||
dnl or version-dependent feature) and you are using pkg-config: | ||
dnl PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, | ||
dnl [ | ||
dnl AC_DEFINE(HAVE_CONGA_FEATURE, 1, [ ]) | ||
dnl ],[ | ||
dnl AC_MSG_ERROR([FEATURE not supported by your conga library.]) | ||
dnl ], [ | ||
dnl $LIBFOO_LIBS | ||
dnl ]) | ||
|
||
dnl If you need to check for a particular library function (e.g. a conditional | ||
dnl or version-dependent feature) and you are not using pkg-config: | ||
dnl PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, | ||
dnl [ | ||
dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $CONGA_DIR/$PHP_LIBDIR, CONGA_SHARED_LIBADD) | ||
dnl AC_DEFINE(HAVE_CONGA_FEATURE, 1, [ ]) | ||
dnl ],[ | ||
dnl AC_MSG_ERROR([FEATURE not supported by your conga library.]) | ||
dnl ],[ | ||
dnl -L$CONGA_DIR/$PHP_LIBDIR -lm | ||
dnl ]) | ||
dnl | ||
dnl PHP_SUBST(CONGA_SHARED_LIBADD) | ||
|
||
dnl In case of no dependencies | ||
AC_DEFINE(HAVE_CONGA, 1, [ Have conga support ]) | ||
|
||
PHP_NEW_EXTENSION(conga, conga.c, $ext_shared) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ARG_ENABLE('conga', 'conga support', 'no'); | ||
|
||
if (PHP_CONGA != 'no') { | ||
AC_DEFINE('HAVE_CONGA', 1, 'conga support enabled'); | ||
|
||
EXTENSION('conga', 'conga.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* conga extension for PHP */ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
# include "config.h" | ||
#endif | ||
|
||
#include "php.h" | ||
#include "ext/standard/info.h" | ||
#include "php_conga.h" | ||
#include "conga_arginfo.h" | ||
|
||
/* For compatibility with older PHP versions */ | ||
#ifndef ZEND_PARSE_PARAMETERS_NONE | ||
#define ZEND_PARSE_PARAMETERS_NONE() \ | ||
ZEND_PARSE_PARAMETERS_START(0, 0) \ | ||
ZEND_PARSE_PARAMETERS_END() | ||
#endif | ||
|
||
/* {{{ void test1() */ | ||
PHP_FUNCTION(test1) | ||
{ | ||
ZEND_PARSE_PARAMETERS_NONE(); | ||
|
||
php_printf("The extension %s is loaded and working!\r\n", "conga"); | ||
} | ||
/* }}} */ | ||
|
||
/* {{{ string test2( [ string $var ] ) */ | ||
PHP_FUNCTION(test2) | ||
{ | ||
char *var = "World"; | ||
size_t var_len = sizeof("World") - 1; | ||
zend_string *retval; | ||
|
||
ZEND_PARSE_PARAMETERS_START(0, 1) | ||
Z_PARAM_OPTIONAL | ||
Z_PARAM_STRING(var, var_len) | ||
ZEND_PARSE_PARAMETERS_END(); | ||
|
||
retval = strpprintf(0, "Hello %s", var); | ||
|
||
RETURN_STR(retval); | ||
} | ||
/* }}}*/ | ||
|
||
/* {{{ PHP_RINIT_FUNCTION */ | ||
PHP_RINIT_FUNCTION(conga) | ||
{ | ||
#if defined(ZTS) && defined(COMPILE_DL_CONGA) | ||
ZEND_TSRMLS_CACHE_UPDATE(); | ||
#endif | ||
|
||
return SUCCESS; | ||
} | ||
/* }}} */ | ||
|
||
/* {{{ PHP_MINFO_FUNCTION */ | ||
PHP_MINFO_FUNCTION(conga) | ||
{ | ||
php_info_print_table_start(); | ||
php_info_print_table_row(2, "conga support", "enabled"); | ||
php_info_print_table_end(); | ||
} | ||
Comment on lines
+60
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines are not covered by tests. |
||
/* }}} */ | ||
|
||
/* {{{ conga_module_entry */ | ||
zend_module_entry conga_module_entry = { | ||
STANDARD_MODULE_HEADER, | ||
"conga", /* Extension name */ | ||
ext_functions, /* zend_function_entry */ | ||
NULL, /* PHP_MINIT - Module initialization */ | ||
NULL, /* PHP_MSHUTDOWN - Module shutdown */ | ||
PHP_RINIT(conga), /* PHP_RINIT - Request initialization */ | ||
NULL, /* PHP_RSHUTDOWN - Request shutdown */ | ||
PHP_MINFO(conga), /* PHP_MINFO - Module info */ | ||
PHP_CONGA_VERSION, /* Version */ | ||
STANDARD_MODULE_PROPERTIES | ||
}; | ||
/* }}} */ | ||
|
||
#ifdef COMPILE_DL_CONGA | ||
# ifdef ZTS | ||
ZEND_TSRMLS_CACHE_DEFINE() | ||
# endif | ||
ZEND_GET_MODULE(conga) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
/** | ||
* @generate-class-entries | ||
* @undocumentable | ||
*/ | ||
|
||
function test1(): void {} | ||
|
||
function test2(string $str = ""): string {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* This is a generated file, edit the .stub.php file instead. | ||
* Stub hash: 54b0ffc3af871b189435266df516f7575c1b9675 */ | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test1, 0, 0, IS_VOID, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test2, 0, 0, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, str, IS_STRING, 0, "\"\"") | ||
ZEND_END_ARG_INFO() | ||
|
||
|
||
ZEND_FUNCTION(test1); | ||
ZEND_FUNCTION(test2); | ||
|
||
|
||
static const zend_function_entry ext_functions[] = { | ||
ZEND_FE(test1, arginfo_test1) | ||
ZEND_FE(test2, arginfo_test2) | ||
ZEND_FE_END | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* conga extension for PHP */ | ||
|
||
#ifndef PHP_CONGA_H | ||
# define PHP_CONGA_H | ||
|
||
extern zend_module_entry conga_module_entry; | ||
# define phpext_conga_ptr &conga_module_entry | ||
|
||
# define PHP_CONGA_VERSION "0.1.0" | ||
|
||
# if defined(ZTS) && defined(COMPILE_DL_CONGA) | ||
ZEND_TSRMLS_CACHE_EXTERN() | ||
# endif | ||
|
||
#endif /* PHP_CONGA_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--TEST-- | ||
Check if conga is loaded | ||
--EXTENSIONS-- | ||
conga | ||
--FILE-- | ||
<?php | ||
echo 'The extension "conga" is available'; | ||
?> | ||
--EXPECT-- | ||
The extension "conga" is available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
test1() Basic test | ||
--EXTENSIONS-- | ||
conga | ||
--FILE-- | ||
<?php | ||
$ret = test1(); | ||
|
||
var_dump($ret); | ||
?> | ||
--EXPECT-- | ||
The extension conga is loaded and working! | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--TEST-- | ||
test2() Basic test | ||
--EXTENSIONS-- | ||
conga | ||
--FILE-- | ||
<?php | ||
var_dump(test2()); | ||
var_dump(test2('PHP')); | ||
?> | ||
--EXPECT-- | ||
string(11) "Hello World" | ||
string(9) "Hello PHP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
Test phpinfo() | ||
--EXTENSIONS-- | ||
conga | ||
--FILE-- | ||
<?php | ||
ob_start( | ||
static fn (string $phpinfo): string | ||
=> str_contains($phpinfo, 'conga support') ? 'Success' : 'Failure' | ||
); | ||
phpinfo(); | ||
ob_end_flush(); | ||
?> | ||
--EXPECT-- | ||
Success |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are not covered by tests.