{'O', 1, "opline log"},
{'r', 0, "run"},
{'E', 0, "step-through-eval"},
+ {'S', 1, "sapi-name"},
#ifndef _WIN32
{'l', 1, "listen"},
{'a', 1, "address-or-any"},
zend_bool remote = 0;
int run = 0;
int step = 0;
+ char *sapi_name;
char *bp_tmp_file;
#ifndef _WIN32
char *address;
opt = 0;
run = 0;
step = 0;
+ sapi_name = NULL;
while ((opt = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
switch (opt) {
case 'e': { /* set execution context */
exec_len = strlen(php_optarg);
if (exec_len) {
+ if (exec) {
+ free(exec);
+ }
exec = strdup(php_optarg);
}
} break;
+
+ case 'S': { /* set SAPI name */
+ if (sapi_name) {
+ free(sapi_name);
+ }
+ sapi_name = strdup(php_optarg);
+ } break;
case 'I': { /* ignore .phpdbginit */
init_file_default = 0;
}
#endif
+ if (sapi_name) {
+ phpdbg->name = sapi_name;
+ }
+
phpdbg->ini_defaults = phpdbg_ini_defaults;
phpdbg->phpinfo_as_text = 1;
phpdbg->php_ini_ignore_cwd = 1;
free(address);
}
#endif
+
+ if (sapi_name) {
+ free(sapi_name);
+ }
free(bp_tmp_file);
phpdbg_writeln(" -O\t-Omy.oplog\t\tSets oplog output file");
phpdbg_writeln(" -r\tN/A\t\t\tRun execution context");
phpdbg_writeln(" -E\tN/A\t\t\tEnable step through eval, careful !");
+ phpdbg_writeln(" -S\t-Scli\t\t\tOverride SAPI name, careful !");
#ifndef _WIN32
phpdbg_writeln(" -l\t-l4000\t\t\tSetup remote console ports");
phpdbg_writeln(" -a\t-a192.168.0.3\t\tSetup remote console bind address");