Lines Matching refs:cmd
97 PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value) in php_exec() argument
115 fp = VCWD_POPEN(cmd, "rb"); in php_exec()
117 fp = VCWD_POPEN(cmd, "r"); in php_exec()
120 php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd); in php_exec()
211 char *cmd; in php_exec_ex() local
217 Z_PARAM_STRING(cmd, cmd_len) in php_exec_ex()
229 if (strlen(cmd) != cmd_len) { in php_exec_ex()
235 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()
291 zend_string *cmd; in php_escape_shell_cmd() local
302 cmd = zend_string_safe_alloc(2, l, 0, 0); in php_escape_shell_cmd()
311 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_cmd()
326 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
328 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd() local
361 ZSTR_VAL(cmd)[y++] = '^'; in php_escape_shell_cmd() local
363 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
367 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd()
371 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_cmd() local
375 zend_string_release(cmd); in php_escape_shell_cmd()
382 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_cmd()
385 ZSTR_LEN(cmd) = y; in php_escape_shell_cmd()
387 return cmd; in php_escape_shell_cmd()
397 zend_string *cmd; in php_escape_shell_arg() local
406 cmd = zend_string_safe_alloc(4, l, 2, 0); /* worst case */ in php_escape_shell_arg()
409 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
411 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
421 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_arg()
432 ZSTR_VAL(cmd)[y++] = ' '; in php_escape_shell_arg() local
436 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
437 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg()
438 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
442 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_arg()
446 if (y > 0 && '\\' == ZSTR_VAL(cmd)[y - 1]) { in php_escape_shell_arg()
448 for (; n >= 0 && '\\' == ZSTR_VAL(cmd)[n]; n--, k++); in php_escape_shell_arg()
450 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg() local
454 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
456 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
458 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_arg() local
462 zend_string_release(cmd); in php_escape_shell_arg()
469 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_arg()
471 ZSTR_LEN(cmd) = y; in php_escape_shell_arg()
472 return cmd; in php_escape_shell_arg()