Lines Matching refs:cmd

60 PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)  in php_exec()  argument
77 fp = VCWD_POPEN(cmd, "rb"); in php_exec()
79 fp = VCWD_POPEN(cmd, "r"); in php_exec()
82 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd); in php_exec()
173 char *cmd; in php_exec_ex() local
179 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE… in php_exec_ex()
183 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_co… in php_exec_ex()
191 if (strlen(cmd) != cmd_len) { in php_exec_ex()
197 ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC); in php_exec_ex()
203 ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC); in php_exec_ex()
248 char *cmd; in php_escape_shell_cmd() local
254 cmd = safe_emalloc(2, l, 1); in php_escape_shell_cmd()
263 memcpy(cmd + y, str + x, mb_len); in php_escape_shell_cmd()
278 cmd[y++] = '\\'; in php_escape_shell_cmd()
280 cmd[y++] = str[x]; in php_escape_shell_cmd()
313 cmd[y++] = '^'; in php_escape_shell_cmd()
315 cmd[y++] = '\\'; in php_escape_shell_cmd()
319 cmd[y++] = str[x]; in php_escape_shell_cmd()
323 cmd[y] = '\0'; in php_escape_shell_cmd()
328 cmd = erealloc(cmd, y + 1); in php_escape_shell_cmd()
331 return cmd; in php_escape_shell_cmd()
340 char *cmd; in php_escape_shell_arg() local
345 cmd = safe_emalloc(4, l, 3); /* worst case */ in php_escape_shell_arg()
348 cmd[y++] = '"'; in php_escape_shell_arg()
350 cmd[y++] = '\''; in php_escape_shell_arg()
360 memcpy(cmd + y, str + x, mb_len); in php_escape_shell_arg()
371 cmd[y++] = ' '; in php_escape_shell_arg()
375 cmd[y++] = '\''; in php_escape_shell_arg()
376 cmd[y++] = '\\'; in php_escape_shell_arg()
377 cmd[y++] = '\''; in php_escape_shell_arg()
381 cmd[y++] = str[x]; in php_escape_shell_arg()
385 if (y > 0 && '\\' == cmd[y - 1]) { in php_escape_shell_arg()
387 for (; n >= 0 && '\\' == cmd[n]; n--, k++); in php_escape_shell_arg()
389 cmd[y++] = '\\'; in php_escape_shell_arg()
393 cmd[y++] = '"'; in php_escape_shell_arg()
395 cmd[y++] = '\''; in php_escape_shell_arg()
397 cmd[y] = '\0'; in php_escape_shell_arg()
402 cmd = erealloc(cmd, y + 1); in php_escape_shell_arg()
404 return cmd; in php_escape_shell_arg()
414 char *cmd = NULL; in PHP_FUNCTION() local
421 cmd = php_escape_shell_cmd(command); in PHP_FUNCTION()
422 RETVAL_STRING(cmd, 0); in PHP_FUNCTION()
435 char *cmd = NULL; in PHP_FUNCTION() local
442 cmd = php_escape_shell_arg(argument); in PHP_FUNCTION()
443 RETVAL_STRING(cmd, 0); in PHP_FUNCTION()