From c0c41907a787f51a94af204536616af7a0b2a3f3 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Fri, 8 Apr 2005 20:14:52 +0000 Subject: [PATCH] WS, preparation for the new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@184001 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/exec/functions/escapeshellarg.xml | 69 ++++--- reference/exec/functions/escapeshellcmd.xml | 69 ++++--- reference/exec/functions/exec.xml | 116 ++++++------ reference/exec/functions/passthru.xml | 82 ++++---- reference/exec/functions/proc-close.xml | 51 +++-- reference/exec/functions/proc-get-status.xml | 185 +++++++++---------- reference/exec/functions/proc-nice.xml | 74 ++++---- reference/exec/functions/proc-terminate.xml | 79 ++++---- reference/exec/functions/shell-exec.xml | 64 ++++--- reference/exec/functions/system.xml | 110 +++++------ 10 files changed, 441 insertions(+), 458 deletions(-) diff --git a/reference/exec/functions/escapeshellarg.xml b/reference/exec/functions/escapeshellarg.xml index 83067f1e32..3e87c62eac 100644 --- a/reference/exec/functions/escapeshellarg.xml +++ b/reference/exec/functions/escapeshellarg.xml @@ -1,45 +1,44 @@ - + - - - escapeshellarg - Escape a string to be used as a shell argument - - - &reftitle.description; - - stringescapeshellarg - stringarg - - - escapeshellarg adds single quotes around a string - and quotes/escapes any existing single quotes allowing you to pass a - string directly to a shell function and having it be treated as a single - safe argument. This function should be used to escape individual - arguments to shell functions coming from user input. The shell functions - include exec, system and the - backtick operator. - A standard use would be: - - - + + + escapeshellarg + Escape a string to be used as a shell argument + + + &reftitle.description; + + stringescapeshellarg + stringarg + + + escapeshellarg adds single quotes around a string + and quotes/escapes any existing single quotes allowing you to pass a + string directly to a shell function and having it be treated as a single + safe argument. This function should be used to escape individual + arguments to shell functions coming from user input. The shell functions + include exec, system and the + backtick operator. + A standard use would be: + + + ]]> - - - - - See also escapeshellcmd, exec, - popen, system, and the backtick operator. - - - - + + + + + See also escapeshellcmd, exec, + popen, system, and the backtick operator. + + + + - - - escapeshellcmd - Escape shell metacharacters - - - &reftitle.description; - - stringescapeshellcmd - stringcommand - - - escapeshellcmd escapes any characters in a - string that might be used to trick a shell command into executing - arbitrary commands. This function should be used to make sure - that any data coming from user input is escaped before this data - is passed to the exec or - system functions, or to the backtick - operator. A standard use would be: - - - + + + escapeshellcmd + Escape shell metacharacters + + + &reftitle.description; + + stringescapeshellcmd + stringcommand + + + escapeshellcmd escapes any characters in a + string that might be used to trick a shell command into executing + arbitrary commands. This function should be used to make sure + that any data coming from user input is escaped before this data + is passed to the exec or + system functions, or to the backtick + operator. A standard use would be: + + + ]]> - - - - - See also escapeshellarg, exec, - popen, system, and the backtick operator. - - - - + + + + + See also escapeshellarg, exec, + popen, system, and the backtick operator. + + + + - - - exec - Execute an external program - - - &reftitle.description; - - stringexec - stringcommand - arrayoutput - intreturn_var - - - exec executes the given - command, however it does not output - anything. It simply returns the last line from the result of the - command. If you need to execute a command and have all the data - from the command passed directly back without any interference, - use the passthru function. - - - If the output argument is present, then the - specified array will be filled with every line of output from the - command. Line endings, such as \n, are not - included in this array. Note that if the array already contains some - elements, exec will append to the end of the array. - If you do not want the function to append elements, call - unset on the array before passing it to - exec. - - - If the return_var argument is present - along with the output argument, then the - return status of the executed command will be written to this - variable. - - - - An <function>exec</function> example - + + + exec + Execute an external program + + + &reftitle.description; + + stringexec + stringcommand + arrayoutput + intreturn_var + + + exec executes the given + command, however it does not output + anything. It simply returns the last line from the result of the + command. If you need to execute a command and have all the data + from the command passed directly back without any interference, + use the passthru function. + + + If the output argument is present, then the + specified array will be filled with every line of output from the + command. Line endings, such as \n, are not + included in this array. Note that if the array already contains some + elements, exec will append to the end of the array. + If you do not want the function to append elements, call + unset on the array before passing it to + exec. + + + If the return_var argument is present + along with the output argument, then the + return status of the executed command will be written to this + variable. + + + + An <function>exec</function> example + ]]> - - - - &warn.escapeshell; - ¬e.exec-bg; - ¬e.exec-path; - &warn.sm.exec; - - See also system, - passthru, popen, - escapeshellcmd - pcntl_exec, and the backtick operator. - - - + + + + &warn.escapeshell; + ¬e.exec-bg; + ¬e.exec-path; + &warn.sm.exec; + + See also system, + passthru, popen, + escapeshellcmd + pcntl_exec, and the backtick operator. + + + + - - - passthru - - Execute an external program and display raw output - - - - &reftitle.description; - - voidpassthru - stringcommand - intreturn_var - - - The passthru function is similar to the - exec function in that it executes a - command. If the - return_var argument is present, the return - status of the Unix command will be placed here. This function - should be used in place of exec or - system when the output from the Unix command - is binary data which needs to be passed directly back to the - browser. A common use for this is to execute something like the - pbmplus utilities that can output an image stream directly. By - setting the Content-type to image/gif and - then calling a pbmplus program to output a gif, you can create - PHP scripts that output images directly. - - &warn.escapeshell; - ¬e.exec-bg; - ¬e.exec-path; - &warn.sm.exec; - - See also exec, system, - popen, escapeshellcmd, - and the backtick - operator. - - - + + + passthru + Execute an external program and display raw output + + + &reftitle.description; + + voidpassthru + stringcommand + intreturn_var + + + The passthru function is similar to the + exec function in that it executes a + command. If the + return_var argument is present, the return + status of the Unix command will be placed here. This function + should be used in place of exec or + system when the output from the Unix command + is binary data which needs to be passed directly back to the + browser. A common use for this is to execute something like the + pbmplus utilities that can output an image stream directly. By + setting the Content-type to image/gif and + then calling a pbmplus program to output a gif, you can create + PHP scripts that output images directly. + + &warn.escapeshell; + ¬e.exec-bg; + ¬e.exec-path; + &warn.sm.exec; + + See also exec, system, + popen, escapeshellcmd, + and the backtick + operator. + + + + - - - proc_close - - Close a process opened by proc_open and return the exit code of that - process. - - - - &reftitle.description; - - intproc_close - resourceprocess - - - proc_close is similar to pclose - except that it only works on processes opened by - proc_open. - proc_close waits for the process to terminate, and - returns its exit code. If you have open pipes to that process, you - should fclose them prior to calling this function in - order to avoid a deadlock - the child process may not be able to exit - while the pipes are open. - - - + + + proc_close + Close a process opened by proc_open and return the exit code of that process. + + + &reftitle.description; + + intproc_close + resourceprocess + + + proc_close is similar to pclose + except that it only works on processes opened by + proc_open. + proc_close waits for the process to terminate, and + returns its exit code. If you have open pipes to that process, you + should fclose them prior to calling this function in + order to avoid a deadlock - the child process may not be able to exit + while the pipes are open. + + + - - - proc_get_status - - Get information about a process opened by proc_open - - - - &reftitle.description; - - arrayproc_get_status - resourceprocess - - - proc_get_status fetches data about a - process opened using proc_open. The - collected information is returned in an array containing the - following elements: - - - - - elementtypedescription - - - - command - string - The command string that was passed to - proc_open - - - pid - int - process id - - - running - bool - - &true; if the process is still running, &false; if it has - terminated - - - - signaled - bool - - &true; if the child process has been terminated by - an uncaught signal. Always set to &false; on Windows. - - - - stopped - bool - - &true; if the child process has been stopped by a - signal. Always set to &false; on Windows. - - - - exitcode - int - - the exit code returned by the process (which is only - meaningful if running is &false;) - - - - termsig - int - - the number of the signal that caused the child process to terminate - its execution (only meaningful if signaled is &true;) - - - - stopsig - int - - the number of the signal that caused the child process to stop its - execution (only meaningful if stopped is &true;) - - - - - - - See also proc_open. - - - + + + + proc_get_status + Get information about a process opened by proc_open + + + &reftitle.description; + + arrayproc_get_status + resourceprocess + + + proc_get_status fetches data about a + process opened using proc_open. The + collected information is returned in an array containing the + following elements: + + + + + elementtypedescription + + + + command + string + + The command string that was passed to proc_open + + + + pid + int + process id + + + running + bool + + &true; if the process is still running, &false; if it has + terminated + + + + signaled + bool + + &true; if the child process has been terminated by + an uncaught signal. Always set to &false; on Windows. + + + + stopped + bool + + &true; if the child process has been stopped by a + signal. Always set to &false; on Windows. + + + + exitcode + int + + the exit code returned by the process (which is only + meaningful if running is &false;) + + + + termsig + int + + the number of the signal that caused the child process to terminate + its execution (only meaningful if signaled is &true;) + + + + stopsig + int + + the number of the signal that caused the child process to stop its + execution (only meaningful if stopped is &true;) + + + + + + + See also proc_open. + + + - - - proc_nice - - Change the priority of the current process - - - - &reftitle.description; - - boolproc_nice - intincrement - - - proc_nice changes the priority of the current - process by the amount specified in increment. A - positive increment will lower the priority of the - current process, whereas a negative increment - will raise the priority. If an error occurs, like the user lacks - permission to change the priority, an error of level - E_WARNING is generated and &false; is returned. - Otherwise, &true; is returned. - - - - proc_nice will only exist if your system has 'nice' - capabilities. 'nice' conforms to: SVr4, SVID EXT, AT&T, X/OPEN, BSD - 4.3. This means that proc_nice is not available - on Windows. - - - - proc_nice is not related to - proc_open and its associated functions in any way. - - - + + + + proc_nice + Change the priority of the current process + + + &reftitle.description; + + boolproc_nice + intincrement + + + proc_nice changes the priority of the current + process by the amount specified in increment. A + positive increment will lower the priority of the + current process, whereas a negative increment + will raise the priority. If an error occurs, like the user lacks + permission to change the priority, an error of level + E_WARNING is generated and &false; is returned. + Otherwise, &true; is returned. + + + + proc_nice will only exist if your system has 'nice' + capabilities. 'nice' conforms to: SVr4, SVID EXT, AT&T, X/OPEN, BSD + 4.3. This means that proc_nice is not available + on Windows. + + + + proc_nice is not related to + proc_open and its associated functions in any way. + + + - - - proc_terminate - - kills a process opened by proc_open - - - - &reftitle.description; - - intproc_terminate - resourceprocess - intsignal - - - - Signals a process (created using - proc_open) that it should terminate. - proc_terminate returns immediately and does not wait - for the process to terminate. - - - The optional - signal is only useful on POSIX - operating systems; you may specify a signal to send to the process using - the kill(2) system call. The default is - SIGTERM. - - - - proc_terminate allows you terminate the process and - continue with other tasks. You may poll the process (to see if it has - stopped yet) by using the proc_get_status function. - - - - See also proc_open, proc_close, - and proc_get_status. - - - + + + + proc_terminate + kills a process opened by proc_open + + + &reftitle.description; + + intproc_terminate + resourceprocess + intsignal + + + Signals a process (created using + proc_open) that it should terminate. + proc_terminate returns immediately and does not wait + for the process to terminate. + + + The optional + signal is only useful on POSIX + operating systems; you may specify a signal to send to the process using + the kill(2) system call. The default is + SIGTERM. + + + proc_terminate allows you terminate the process and + continue with other tasks. You may poll the process (to see if it has + stopped yet) by using the proc_get_status function. + + + See also proc_open, proc_close, + and proc_get_status. + + + + - - - shell_exec - - Execute command via shell and return the complete output as a string - - - - &reftitle.description; - - stringshell_exec - stringcmd - - - This function is identical to the backtick operator. - - - - A <function>shell_exec</function> example - + + + shell_exec + Execute command via shell and return the complete output as a string + + + &reftitle.description; + + stringshell_exec + stringcmd + + + This function is identical to the backtick operator. + + + + A <function>shell_exec</function> example + $output"; ?> ]]> - - - - - ¬e.sm.disabled; + + + - - See also exec and - escapeshellcmd. - - - + ¬e.sm.disabled; + + + See also exec and + escapeshellcmd. + + + + - - - system - Execute an external program and display the output - - - &reftitle.description; - - stringsystem - stringcommand - intreturn_var - - - system is just like the C version of the - function in that it executes the given - command and outputs the result. If a - variable is provided as the second argument, then the return - status code of the executed command will be written to this - variable. - - &warn.escapeshell; - ¬e.exec-bg; - - The system call also tries to automatically - flush the web server's output buffer after each line of output if - PHP is running as a server module. - - - Returns the last line of the command output on success, and &false; - on failure. - - - If you need to execute a command and have all the data from the - command passed directly back without any interference, use the - passthru function. - - - - <function>system</function> example - + + + system + Execute an external program and display the output + + + &reftitle.description; + + stringsystem + stringcommand + intreturn_var + + + system is just like the C version of the + function in that it executes the given + command and outputs the result. If a + variable is provided as the second argument, then the return + status code of the executed command will be written to this + variable. + + &warn.escapeshell; + ¬e.exec-bg; + + The system call also tries to automatically + flush the web server's output buffer after each line of output if + PHP is running as a server module. + + + Returns the last line of the command output on success, and &false; + on failure. + + + If you need to execute a command and have all the data from the + command passed directly back without any interference, use the + passthru function. + + + + <function>system</function> example + '; @@ -57,20 +57,20 @@ echo '
Return value: ' . $retval; ?> ]]> -
-
-
- ¬e.exec-path; - &warn.sm.exec; - - See also exec, - passthru, popen, - escapeshellcmd, - pcntl_exec, and the backtick operator. - -
-
+
+
+
+ ¬e.exec-path; + &warn.sm.exec; + + See also exec, + passthru, popen, + escapeshellcmd, + pcntl_exec, and the backtick operator. + +
+