summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 3b053e223a..51e0a03fe8 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -182,14 +182,6 @@ const opt_struct OPTIONS[] = {
{'-', 0, NULL} /* end of args */
};
-static int print_module_info(zval *element) /* {{{ */
-{
- zend_module_entry *module = (zend_module_entry*)Z_PTR_P(element);
- php_printf("%s\n", module->name);
- return ZEND_HASH_APPLY_KEEP;
-}
-/* }}} */
-
static int module_name_cmp(const void *a, const void *b) /* {{{ */
{
Bucket *f = (Bucket *) a;
@@ -203,11 +195,14 @@ static int module_name_cmp(const void *a, const void *b) /* {{{ */
static void print_modules(void) /* {{{ */
{
HashTable sorted_registry;
+ zend_module_entry *module;
zend_hash_init(&sorted_registry, 50, NULL, NULL, 0);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
zend_hash_sort(&sorted_registry, module_name_cmp, 0);
- zend_hash_apply(&sorted_registry, print_module_info);
+ ZEND_HASH_FOREACH_PTR(&sorted_registry, module) {
+ php_printf("%s\n", module->name);
+ } ZEND_HASH_FOREACH_END();
zend_hash_destroy(&sorted_registry);
}
/* }}} */
@@ -683,7 +678,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
goto out;
case 'v': /* show php version & quit */
- php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2018 The PHP Group\n%s",
+ php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) The PHP Group\n%s",
PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
#if ZTS
"ZTS "
@@ -1427,12 +1422,3 @@ out:
exit(exit_status);
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */