Lines Matching refs:cmd

93 PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)  in php_exec()  argument
111 fp = VCWD_POPEN(cmd, "rb"); in php_exec()
113 fp = VCWD_POPEN(cmd, "r"); in php_exec()
116 php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd); in php_exec()
215 char *cmd; in php_exec_ex() local
221 Z_PARAM_STRING(cmd, cmd_len) in php_exec_ex()
233 if (strlen(cmd) != cmd_len) { in php_exec_ex()
239 ret = php_exec(mode, cmd, NULL, return_value); in php_exec_ex()
251 ret = php_exec(2, cmd, ret_array, return_value); in php_exec_ex()
297 zend_string *cmd; in php_escape_shell_cmd() local
308 cmd = zend_string_safe_alloc(2, l, 0, 0); in php_escape_shell_cmd()
317 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_cmd()
332 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
334 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd() local
367 ZSTR_VAL(cmd)[y++] = '^'; in php_escape_shell_cmd() local
369 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_cmd() local
373 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_cmd()
377 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_cmd() local
381 zend_string_release_ex(cmd, 0); in php_escape_shell_cmd()
388 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_cmd()
391 ZSTR_LEN(cmd) = y; in php_escape_shell_cmd()
393 return cmd; in php_escape_shell_cmd()
403 zend_string *cmd; in php_escape_shell_arg() local
412 cmd = zend_string_safe_alloc(4, l, 2, 0); /* worst case */ in php_escape_shell_arg()
415 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
417 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
427 memcpy(ZSTR_VAL(cmd) + y, str + x, mb_len); in php_escape_shell_arg()
438 ZSTR_VAL(cmd)[y++] = ' '; in php_escape_shell_arg() local
442 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
443 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg()
444 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg()
448 ZSTR_VAL(cmd)[y++] = str[x]; in php_escape_shell_arg()
452 if (y > 0 && '\\' == ZSTR_VAL(cmd)[y - 1]) { in php_escape_shell_arg()
454 for (; n >= 0 && '\\' == ZSTR_VAL(cmd)[n]; n--, k++); in php_escape_shell_arg()
456 ZSTR_VAL(cmd)[y++] = '\\'; in php_escape_shell_arg() local
460 ZSTR_VAL(cmd)[y++] = '"'; in php_escape_shell_arg() local
462 ZSTR_VAL(cmd)[y++] = '\''; in php_escape_shell_arg() local
464 ZSTR_VAL(cmd)[y] = '\0'; in php_escape_shell_arg() local
468 zend_string_release_ex(cmd, 0); in php_escape_shell_arg()
475 cmd = zend_string_truncate(cmd, y, 0); in php_escape_shell_arg()
477 ZSTR_LEN(cmd) = y; in php_escape_shell_arg()
478 return cmd; in php_escape_shell_arg()