Lines Matching refs:cmd
114 PHPAPI int php_exec(int type, const char *cmd, zval *array, zval *return_value) in php_exec() argument
131 fp = VCWD_POPEN(cmd, "rb"); in php_exec()
133 fp = VCWD_POPEN(cmd, "r"); in php_exec()
136 php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd); in php_exec()
208 char *cmd; in php_exec_ex() local
214 Z_PARAM_STRING(cmd, cmd_len) in php_exec_ex()
226 if (strlen(cmd) != cmd_len) { in php_exec_ex()
232 ret = php_exec(mode, cmd, NULL, return_value); in php_exec_ex()
244 ret = php_exec(2, cmd, ret_array, return_value); in php_exec_ex()
287 zend_string *cmd; in php_escape_shell_cmd() local
298 cmd = zend_string_safe_alloc(2, l, 0, 0); in php_escape_shell_cmd()
307 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_cmd()
322 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
324 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd() local
357 ZSTR_VAL(cmd)[y++] = '^'; in php_escape_shell_cmd() local
359 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
363 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd()
367 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_cmd() local
371 zend_string_release_ex(cmd, 0); in php_escape_shell_cmd()
378 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_cmd()
381 ZSTR_LEN(cmd) = y; in php_escape_shell_cmd()
383 return cmd; in php_escape_shell_cmd()
392 zend_string *cmd; in php_escape_shell_arg() local
401 cmd = zend_string_safe_alloc(4, l, 2, 0); /* worst case */ in php_escape_shell_arg()
404 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
406 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
416 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_arg()
427 ZSTR_VAL(cmd)[y++] = ' '; in php_escape_shell_arg() local
431 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
432 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg()
433 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
437 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_arg()
441 if (y > 0 && '\\' == ZSTR_VAL(cmd)[y - 1]) { in php_escape_shell_arg()
443 for (; n >= 0 && '\\' == ZSTR_VAL(cmd)[n]; n--, k++); in php_escape_shell_arg()
445 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg() local
449 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
451 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
453 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_arg() local
457 zend_string_release_ex(cmd, 0); in php_escape_shell_arg()
464 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_arg()
466 ZSTR_LEN(cmd) = y; in php_escape_shell_arg()
467 return cmd; in php_escape_shell_arg()