Skip to content

Commit 03a3faa

Browse files
committed
Sync sysvsem and sysvshm versions in phpinfo
This patch removes the versions of the sysvsem and sysvshm extensions in the phpinfo output to sync them with PHP core and bundled extensions versions displayed. Instead it displays the extension enabled status.
1 parent e147eb2 commit 03a3faa

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

ext/sysvsem/php_sysvsem.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern zend_module_entry sysvsem_module_entry;
3030
#define PHP_SYSVSEM_VERSION PHP_VERSION
3131

3232
PHP_MINIT_FUNCTION(sysvsem);
33+
PHP_MINFO_FUNCTION(sysvsem);
3334
PHP_FUNCTION(sem_get);
3435
PHP_FUNCTION(sem_acquire);
3536
PHP_FUNCTION(sem_release);

ext/sysvsem/sysvsem.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <errno.h>
4242

4343
#include "php_sysvsem.h"
44+
#include "ext/standard/info.h"
4445

4546
#if !HAVE_SEMUN
4647

@@ -99,7 +100,7 @@ zend_module_entry sysvsem_module_entry = {
99100
NULL,
100101
NULL,
101102
NULL,
102-
NULL,
103+
PHP_MINFO(sysvsem),
103104
PHP_SYSVSEM_VERSION,
104105
STANDARD_MODULE_PROPERTIES
105106
};
@@ -178,6 +179,16 @@ PHP_MINIT_FUNCTION(sysvsem)
178179
}
179180
/* }}} */
180181

182+
/* {{{ PHP_MINFO_FUNCTION
183+
*/
184+
PHP_MINFO_FUNCTION(sysvsem)
185+
{
186+
php_info_print_table_start();
187+
php_info_print_table_row(2, "sysvsem support", "enabled");
188+
php_info_print_table_end();
189+
}
190+
/* }}} */
191+
181192
#define SETVAL_WANTS_PTR
182193

183194
#if defined(_AIX)

ext/sysvshm/php_sysvshm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ typedef struct {
7171
} sysvshm_shm;
7272

7373
PHP_MINIT_FUNCTION(sysvshm);
74+
PHP_MINFO_FUNCTION(sysvshm);
7475
PHP_FUNCTION(shm_attach);
7576
PHP_FUNCTION(shm_detach);
7677
PHP_FUNCTION(shm_remove);

ext/sysvshm/sysvshm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <errno.h>
3636

3737
#include "php_sysvshm.h"
38+
#include "ext/standard/info.h"
3839
#include "ext/standard/php_var.h"
3940
#include "zend_smart_str.h"
4041
#include "php_ini.h"
@@ -100,7 +101,7 @@ zend_module_entry sysvshm_module_entry = {
100101
NULL,
101102
NULL,
102103
NULL,
103-
NULL,
104+
PHP_MINFO(sysvshm),
104105
PHP_SYSVSHM_VERSION,
105106
STANDARD_MODULE_PROPERTIES
106107
};
@@ -147,6 +148,16 @@ PHP_MINIT_FUNCTION(sysvshm)
147148
}
148149
/* }}} */
149150

151+
/* {{{ PHP_MINFO_FUNCTION
152+
*/
153+
PHP_MINFO_FUNCTION(sysvshm)
154+
{
155+
php_info_print_table_start();
156+
php_info_print_table_row(2, "sysvshm support", "enabled");
157+
php_info_print_table_end();
158+
}
159+
/* }}} */
160+
150161
/* {{{ proto int shm_attach(int key [, int memsize [, int perm]])
151162
Creates or open a shared memory segment */
152163
PHP_FUNCTION(shm_attach)

0 commit comments

Comments
 (0)