Command line style
The System functions are called like there
commandline pendants
if (!System::rm('-r file1 dir1')) {
print "Could not delete all the files";
} |
The arguments of the functions can be introduced as string or array:
System::rm(array('-r', 'file1', 'dir1')); |
System works like any other PHP function and will return
FALSE,
when the operation could no be completed enterely or partially. System
won't stop when a error is found, it will try to continue. For example,
if you are trying to delete three files and the first one can't be deleted,
the next two files will be deleted but the function will return
FALSE.
Errors will be printed out using the PHP function
trigger_error()() so all
the System methods can be silenced prefix a '@' sign before the function
call (for example: @System::mkdir('-p dir1/dir2/dir3');).
Compatibility
System provides file system functions.
They are named like the file system commands on Unix systems
and supports the same options independent
of your operation system.
At the moment the functions are tested under Linux and Windows. Further
reports about compatibility on other systems are welcome.
Warning |
In earlier versions of PHP 4, unlink() may fail
on Windows. This bug is already fixed in up-to-date versions.
|
Man Pages
This manual describes the parameters of the System
functions, most only a string. The arguments and options of the specific
command are not documented in the manual. Please take
a look on the man-pages on unix-like systems
or when man-pages not avaible on your system, visit the
On-line UNIX manual pages