Wrong package... woops
[viewsvn.git] / includes / shellcmd.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # ViewSVN [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 /**
14 * Class that interacts with the command line system
15 *
16 * @pacakge ViewSVN
17 */
18
19 /**
20 * Interacts with the command line via escapes and executions
21 *
22 * @package ViewSVN
23 * @version $Id$
24 */
25 class Shell
26 {
27 /**
28 * Wrapper for escapeshellarg()
29 *
30 * @access public
31 *
32 * @param string The argument
33 *
34 * @return string Cleaned argument
35 */
36 function arg($argument)
37 {
38 return escapeshellarg($argument);
39 }
40
41 /**
42 * Wrapper for escapeshellcmd
43 *
44 * @access public
45 *
46 * @param string Command
47 *
48 * @return string Cleaned command
49 */
50 function cmd($command)
51 {
52 return escapeshellcmd($command);
53 }
54
55 /**
56 * Executes a shell command and returns all the output
57 * as an array
58 *
59 * @access public
60 *
61 * @param string UNIX command
62 *
63 * @return array Output
64 */
65 function exec($command)
66 {
67 exec($command, $output);
68 return $output;
69 }
70 }
71
72 /*=====================================================================*\
73 || ###################################################################
74 || # $HeadURL$
75 || # $Id$
76 || ###################################################################
77 \*=====================================================================*/
78 ?>