|
14 | 14 | +----------------------------------------------------------------------+ |
15 | 15 | */ |
16 | 16 |
|
17 | | -/* $Id: 9e494000a6495581a5d59439cf15504c2bbdeaad */ |
| 17 | +/* $Id: 54ad6d15fb4330384673e6d6a8317c46d0ca78a3 */ |
18 | 18 |
|
19 | 19 | #ifndef SWOOLE_LIBRARY_H |
20 | 20 | #define SWOOLE_LIBRARY_H |
@@ -11003,6 +11003,10 @@ static const char* swoole_library_source_functions = |
11003 | 11003 | " * @var array<string, mixed>\n" |
11004 | 11004 | " */\n" |
11005 | 11005 | " public static array $options = [];\n" |
| 11006 | + "\n" |
| 11007 | + " public static bool $remote_object_server_initiated = false;\n" |
| 11008 | + "\n" |
| 11009 | + " public static string $remote_object_server_socket_file = '';\n" |
11006 | 11010 | "}\n" |
11007 | 11011 | "\n" |
11008 | 11012 | "/**\n" |
@@ -11240,13 +11244,19 @@ static const char* swoole_library_source_functions = |
11240 | 11244 | "\n" |
11241 | 11245 | "function swoole_get_default_remote_object_client(): Swoole\\RemoteObject\\Client\n" |
11242 | 11246 | "{\n" |
11243 | | - " $dir = swoole_library_get_option('default_remote_object_server_dir');\n" |
11244 | | - " if (empty($dir)) {\n" |
11245 | | - " $home = getenv('HOME') ?: sys_get_temp_dir();\n" |
11246 | | - " $dir = $home . '/.swoole';\n" |
| 11247 | + " if (!SwooleLibrary::$remote_object_server_initiated) {\n" |
| 11248 | + " SwooleLibrary::$remote_object_server_initiated = true;\n" |
| 11249 | + " swoole_init_default_remote_object_server();\n" |
| 11250 | + " }\n" |
| 11251 | + " if (!SwooleLibrary::$remote_object_server_socket_file) {\n" |
| 11252 | + " $dir = swoole_library_get_option('default_remote_object_server_dir');\n" |
| 11253 | + " if (empty($dir)) {\n" |
| 11254 | + " $home = getenv('HOME') ?: sys_get_temp_dir();\n" |
| 11255 | + " $dir = $home . '/.swoole';\n" |
| 11256 | + " }\n" |
| 11257 | + " SwooleLibrary::$remote_object_server_socket_file = 'unix://' . $dir . '/remote-object-server.sock';\n" |
11247 | 11258 | " }\n" |
11248 | | - " $socket_file = 'unix://' . $dir . '/remote-object-server.sock';\n" |
11249 | | - " return new Swoole\\RemoteObject\\Client($socket_file);\n" |
| 11259 | + " return new Swoole\\RemoteObject\\Client(SwooleLibrary::$remote_object_server_socket_file);\n" |
11250 | 11260 | "}\n"; |
11251 | 11261 |
|
11252 | 11262 | static const char* swoole_library_source_alias = |
|
0 commit comments