Skip to content

Commit 093153a

Browse files
committed
Declare ext/readline constants in stubs
1 parent eff9aed commit 093153a

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

ext/readline/readline.stub.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
/** @generate-class-entries */
44

5+
/**
6+
* @var string
7+
* @cvalue READLINE_LIB
8+
*/
9+
const READLINE_LIB = UNKNOWN;
10+
511
function readline(?string $prompt = null): string|false {}
612

713
/** @param int|string|bool|null $value */

ext/readline/readline_arginfo.h

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/readline/readline_cli.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,7 @@ PHP_MINIT_FUNCTION(cli_readline)
771771
ZEND_INIT_MODULE_GLOBALS(cli_readline, cli_readline_init_globals, NULL);
772772
REGISTER_INI_ENTRIES();
773773

774-
#if HAVE_LIBEDIT
775-
REGISTER_STRING_CONSTANT("READLINE_LIB", "libedit", CONST_CS|CONST_PERSISTENT);
776-
#else
777-
REGISTER_STRING_CONSTANT("READLINE_LIB", "readline", CONST_CS|CONST_PERSISTENT);
778-
#endif
774+
register_readline_symbols(module_number);
779775

780776
GET_SHELL_CB(cb);
781777
if (cb) {

ext/readline/readline_cli.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ ZEND_END_MODULE_GLOBALS(cli_readline)
3030
# define CLIR_G(v) (cli_readline_globals.v)
3131
#endif
3232

33+
#if HAVE_LIBEDIT
34+
#define READLINE_LIB "libedit"
35+
#else
36+
#define READLINE_LIB "readline"
37+
#endif
38+
3339
extern PHP_MINIT_FUNCTION(cli_readline);
3440
extern PHP_MSHUTDOWN_FUNCTION(cli_readline);
3541
extern PHP_MINFO_FUNCTION(cli_readline);

0 commit comments

Comments
 (0)