Skip to content

Commit

Permalink
Fix config.m4, Support create server in php_embed SAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Dec 19, 2023
1 parent eb9a16e commit 03b2639
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,14 @@ EOF
AC_DEFINE(SW_USE_MYSQLND, 1, [use mysqlnd])
fi

ext_src_files=$(find ext-src/ -name *.cc)
lib_src_files=$(find src/ -name *.cc)
if test -f "ext-src/php_swoole.cc"; then
swoole_source_dir=$(pwd)
else
swoole_source_dir="ext/swoole"
fi

ext_src_files=$(cd $swoole_source_dir && find ext-src/ -name *.cc)
lib_src_files=$(cd $swoole_source_dir && find src/ -name *.cc)
swoole_source_file="${ext_src_files} ${lib_src_files}"

This comment has been minimized.

Copy link
@remicollet

remicollet Jan 24, 2024

Contributor

This break out of sources tree, see PR #5239


swoole_source_file="$swoole_source_file \
Expand Down
5 changes: 3 additions & 2 deletions ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,8 @@ PHP_MINIT_FUNCTION(swoole) {

// init bug report message
bug_report_message_init();
if (strcmp("cli", sapi_module.name) == 0 || strcmp("phpdbg", sapi_module.name) == 0) {
if (strcmp("cli", sapi_module.name) == 0 || strcmp("phpdbg", sapi_module.name) == 0 ||
strcmp("embed", sapi_module.name) == 0) {
SWOOLE_G(cli) = 1;
}

Expand Down Expand Up @@ -998,7 +999,7 @@ PHP_RINIT_FUNCTION(swoole) {
* This would cause php_swoole_load_library function not to execute correctly, so it must be replaced
* with the execute_ex function.
*/
void (*old_zend_execute_ex)(zend_execute_data *execute_data) = nullptr;
void (*old_zend_execute_ex)(zend_execute_data * execute_data) = nullptr;
if (UNEXPECTED(zend_execute_ex != execute_ex)) {
old_zend_execute_ex = zend_execute_ex;
zend_execute_ex = execute_ex;
Expand Down

0 comments on commit 03b2639

Please sign in to comment.