Skip to content

Commit

Permalink
Move php_swoole_load_library to RINIT.
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed May 28, 2019
1 parent 54c174e commit 2ee8a1d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions remake_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ __DIR__=$(cd "$(dirname "$0")";pwd)
set -e
cd ${__DIR__}
set +e
echo "rm swoole_runtime.lo"
rm swoole_runtime.lo
echo "rm swoole.lo"
rm swoole.lo
echo "rm php_swoole_library.h"
rm php_swoole_library.h
set -e
Expand Down
5 changes: 3 additions & 2 deletions swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/
#include "php_swoole_cxx.h"
#include "zend_variables.h"
#include "php_swoole_library.h"

#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
#include "ext/pcre/php_pcre.h"
Expand Down Expand Up @@ -933,8 +933,9 @@ PHP_MINFO_FUNCTION(swoole)
PHP_RINIT_FUNCTION(swoole)
{
SWOOLE_G(req_status) = PHP_SWOOLE_RINIT_BEGIN;
php_swoole_register_shutdown_function("swoole_internal_call_user_shutdown_begin");
SwooleG.running = 1;
php_swoole_register_shutdown_function("swoole_internal_call_user_shutdown_begin");
php_swoole_load_library();
SWOOLE_G(req_status) = PHP_SWOOLE_RINIT_END;
return SUCCESS;
}
Expand Down
4 changes: 0 additions & 4 deletions swoole_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ static int socket_close(php_stream *stream, int close_handle);
static int socket_stat(php_stream *stream, php_stream_statbuf *ssb);
static int socket_cast(php_stream *stream, int castas, void **ret);

#include "php_swoole_library.h"

static void replace_internal_function(const char *name, size_t l_name);
static void recover_internal_function(const char *name, size_t l_name);

Expand Down Expand Up @@ -1248,8 +1246,6 @@ bool PHPCoroutine::inject_function()
return false;
}

php_swoole_load_library();

function_table = (zend_array*) emalloc(sizeof(zend_array));
zend_hash_init(function_table, 8, NULL, NULL, 0);
/**
Expand Down

0 comments on commit 2ee8a1d

Please sign in to comment.