2 /*=====================================================================*\
3 || ###################################################################
4 || # ViewSVN [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
23 * Class that interacts with the command line system
29 * Interacts with the command line via escapes and executions
41 var $controller = null
;
43 // ###################################################################
49 * @param object Controller
51 function Shell(&$contoller)
53 $this->controller
=& $controller;
57 * Wrapper for escapeshellarg()
61 * @param string The argument
63 * @return string Cleaned argument
65 function arg($argument)
67 return escapeshellarg($argument);
71 * Wrapper for escapeshellcmd
75 * @param string Command
77 * @return string Cleaned command
79 function cmd($command)
81 return escapeshellcmd($command);
85 * Executes a shell command and returns all the output
90 * @param string UNIX command
92 * @return array Output
94 function exec($command)
98 exec($command, $output);
100 $this->controller
->registry
->debug("exec(" . $this->controller
->registry
->funct
->fetch_microtime_diff($start) . "): $command");
106 /*=====================================================================*\
107 || ###################################################################
110 || ###################################################################
111 \*=====================================================================*/