Introduction

Introduction – General usage informations

Command line style

The System functions are called like there commandline pendants

<?php
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:

<?php
System
::rm(array('-r''file1''dir1'));
?>

System works like any other PHP function and will return FALSE, when the operation could not be completed entirely 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.

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

man commandname

or when man-pages not available on your system, visit the On-line UNIX manual pages

System (Previous) remove files (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.