]>
src.bluestatic.org Git - viewsvn.git/blob - includes/shellcmd.php
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 * This class is the Xquery interface. It is responsible for doing the
30 * actual interaction with the command line.
42 var $controller = null;
44 // ###################################################################
50 * @param object Controller
52 function Shell(&$controller)
54 $this->controller
=& $controller;
57 // ###################################################################
59 * Wrapper for escapeshellarg()
63 * @param string The argument
65 * @return string Cleaned argument
67 function arg($argument)
69 return escapeshellarg($argument);
72 // ###################################################################
74 * Wrapper for escapeshellcmd
78 * @param string Command
80 * @return string Cleaned command
82 function cmd($command)
84 return escapeshellcmd($command);
87 // ###################################################################
89 * Executes a shell command and returns all the output
94 * @param string UNIX command
96 * @return array Output
98 function exec($command)
100 $start = microtime();
102 exec($command, $output);
104 $this->controller
->registry
->debug("exec(" . $this->controller
->registry
->funct
->fetch_microtime_diff($start) . "): $command");
110 /*=====================================================================*\
111 || ###################################################################
114 || ###################################################################
115 \*=====================================================================*/