System class/package?
| From: | Stig S. Bakken | Date: | Thu, 02 Aug 2001 08:26:08 +0000 |
| Subject: | System class/package? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-1224@lists.php.net to get a copy of this message | ||
We need a way to provide portable substitutions for commands like "rm
-rf", "mkdir -p" and so on. So I'ld like to make a "System" class
providing function for each command.
In general we could take a UNIX command, make a function for it that
takes two parameters: the regular list of arguments, and a list of
options. For example:
System::rm($this->tmpdir, "recursive")
or with multiple params/options:
System::cp(array("original.dat", "copy.dat"), array("preserve",
"verbose"))
Does anyone think it's ugly to put these functions straight into the
"System" class?
- Stig