version 1.1.1.2, 2012/05/29 12:34:35
|
version 1.1.1.5, 2014/06/15 20:04:02
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| 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 | |
| that is bundled with this package in the file LICENSE, and is | |
Line 498 static void php_cli_usage(char *argv0)
|
Line 498 static void php_cli_usage(char *argv0)
|
" %s [options] -r <code> [--] [args...]\n" |
" %s [options] -r <code> [--] [args...]\n" |
" %s [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]\n" |
" %s [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]\n" |
" %s [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]\n" |
" %s [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]\n" |
|
" %s [options] -S <addr>:<port> [-t docroot]\n" |
" %s [options] -- [args...]\n" |
" %s [options] -- [args...]\n" |
" %s [options] -a\n" |
" %s [options] -a\n" |
"\n" |
"\n" |
Line 539 static void php_cli_usage(char *argv0)
|
Line 540 static void php_cli_usage(char *argv0)
|
" --rz <name> Show information about Zend extension <name>.\n" |
" --rz <name> Show information about Zend extension <name>.\n" |
" --ri <name> Show configuration for extension <name>.\n" |
" --ri <name> Show configuration for extension <name>.\n" |
"\n" |
"\n" |
, prog, prog, prog, prog, prog, prog); | , prog, prog, prog, prog, prog, prog, prog); |
} |
} |
/* }}} */ |
/* }}} */ |
|
|
Line 662 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
Line 663 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
int php_optind = 1, orig_optind = 1; |
int php_optind = 1, orig_optind = 1; |
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; |
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; |
char *arg_free=NULL, **arg_excp=&arg_free; |
char *arg_free=NULL, **arg_excp=&arg_free; |
char *script_file=NULL; | char *script_file=NULL, *translated_path = NULL; |
int interactive=0; |
int interactive=0; |
int lineno = 0; |
int lineno = 0; |
const char *param_error=NULL; |
const char *param_error=NULL; |
Line 687 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
Line 688 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
goto out; |
goto out; |
|
|
case 'v': /* show php version & quit */ |
case 'v': /* show php version & quit */ |
php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2012 The PHP Group\n%s", | php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2014 The PHP Group\n%s", |
PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, |
PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, |
#if ZEND_DEBUG && defined(HAVE_GCOV) |
#if ZEND_DEBUG && defined(HAVE_GCOV) |
"(DEBUG GCOV)", |
"(DEBUG GCOV)", |
Line 927 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
Line 928 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
if (script_file) { |
if (script_file) { |
if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { |
if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { |
goto err; |
goto err; |
|
} else { |
|
char real_path[MAXPATHLEN]; |
|
if (VCWD_REALPATH(script_file, real_path)) { |
|
translated_path = strdup(real_path); |
|
} |
|
script_filename = script_file; |
} |
} |
script_filename = script_file; |
|
} else { |
} else { |
/* We could handle PHP_MODE_PROCESS_STDIN in a different manner */ |
/* We could handle PHP_MODE_PROCESS_STDIN in a different manner */ |
/* here but this would make things only more complicated. And it */ |
/* here but this would make things only more complicated. And it */ |
Line 947 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
Line 953 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
SG(request_info).argc=argc-php_optind+1; |
SG(request_info).argc=argc-php_optind+1; |
arg_excp = argv+php_optind-1; |
arg_excp = argv+php_optind-1; |
arg_free = argv[php_optind-1]; |
arg_free = argv[php_optind-1]; |
SG(request_info).path_translated = (char*)file_handle.filename; | SG(request_info).path_translated = translated_path? translated_path: (char*)file_handle.filename; |
argv[php_optind-1] = (char*)file_handle.filename; |
argv[php_optind-1] = (char*)file_handle.filename; |
SG(request_info).argv=argv+php_optind-1; |
SG(request_info).argv=argv+php_optind-1; |
|
|
Line 1162 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
Line 1168 static int do_cli(int argc, char **argv TSRMLS_DC) /*
|
} zend_end_try(); |
} zend_end_try(); |
|
|
out: |
out: |
if (exit_status == 0) { |
|
exit_status = EG(exit_status); |
|
} |
|
if (request_started) { |
if (request_started) { |
php_request_shutdown((void *) 0); |
php_request_shutdown((void *) 0); |
|
} |
|
if (translated_path) { |
|
free(translated_path); |
|
} |
|
if (exit_status == 0) { |
|
exit_status = EG(exit_status); |
} |
} |
return exit_status; |
return exit_status; |
err: |
err: |