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.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 91f400aca4..d068952343 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -175,11 +173,8 @@ const opt_struct OPTIONS[] = {
{'-', 0, NULL} /* end of args */
};
-static int module_name_cmp(const void *a, const void *b) /* {{{ */
+static int module_name_cmp(Bucket *f, Bucket *s) /* {{{ */
{
- Bucket *f = (Bucket *) a;
- Bucket *s = (Bucket *) b;
-
return strcasecmp(((zend_module_entry *)Z_PTR(f->val))->name,
((zend_module_entry *)Z_PTR(s->val))->name);
}
@@ -200,10 +195,9 @@ static void print_modules(void) /* {{{ */
}
/* }}} */
-static int print_extension_info(zend_extension *ext, void *arg) /* {{{ */
+static void print_extension_info(zend_extension *ext) /* {{{ */
{
php_printf("%s\n", ext->name);
- return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -416,7 +410,7 @@ static int php_cli_startup(sapi_module_struct *sapi_module) /* {{{ */
/* {{{ sapi_cli_ini_defaults */
-/* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */
+/* overwritable ini defaults must be set in sapi_cli_ini_defaults() */
#define INI_DEFAULT(name,value)\
ZVAL_NEW_STR(&tmp, zend_string_init(value, sizeof(value)-1, 1));\
zend_hash_str_update(configuration_hash, name, sizeof(name)-1, &tmp);\
@@ -498,7 +492,7 @@ static void php_cli_usage(char *argv0)
" %s [options] -- [args...]\n"
" %s [options] -a\n"
"\n"
-#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+#if (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)) && !defined(COMPILE_DL_READLINE)
" -a Run as interactive shell\n"
#else
" -a Run interactively\n"
@@ -650,7 +644,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
case 'v': /* show php version & quit */
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
+#ifdef ZTS
"ZTS "
#else
"NTS "
@@ -880,7 +874,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
#endif
if (interactive) {
-#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+#if (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)) && !defined(COMPILE_DL_READLINE)
printf("Interactive shell\n\n");
#else
printf("Interactive mode enabled\n\n");
@@ -911,7 +905,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
} else {
/* We could handle PHP_MODE_PROCESS_STDIN in a different manner */
/* here but this would make things only more complicated. And it */
- /* is consitent with the way -R works where the stdin file handle*/
+ /* is consistent with the way -R works where the stdin file handle*/
/* is also accessible. */
zend_stream_init_fp(&file_handle, stdin, "Standard input code");
}
@@ -1076,7 +1070,7 @@ static int do_cli(int argc, char **argv) /* {{{ */
memset(&execute_data, 0, sizeof(zend_execute_data));
EG(current_execute_data) = &execute_data;
- zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, &arg);
+ zend_call_method_with_1_params(Z_OBJ(ref), pce, &pce->constructor, "__construct", NULL, &arg);
if (EG(exception)) {
zval tmp, *msg, rv;