PHP-Shell by v0.1 by fatalus
Easy to use package to run useful Shell commonds from PHP. Supports every PHP version subsequent to PHP 8.0.
use fatalus\PhpShell\Shell;
// You cann call commands statically
Shell::whoami();
// Or you can call them by reference, whatever you prefer ;)
$shell = new Shell();
$shell->which('php');
// Or if you're only interested in specific Commands you can simply call them like this:
use fatalus\PhpShell\UtilityCommands;
UtilityCommands::whoami();
Call | Description | Return Type |
---|---|---|
Utility Commands | ||
UtilityCommands::whoami() | Return the current user | (string) |
UtilityCommands::which() | Returns the executable path of given program if installed | (string) |
UtilityCommands::tar() | De-/compress directories using the tar algorithm | (bool) |
UtilityCommands::gzip() | De-/compress files using the gzip algorithm | (bool) |
UtilityCommands::gunzip() | Decompress files using the gzip algorithm | (bool) |
UtilityCommands::zip() | Compress files & Direcotories using the zip algorithm | (bool) |
UtilityCommands::unzip() | Decompress files & Direcotories using the zip algorithm | (bool) |
Database Commands | ||
DatabaseCommands::mysqldump() | Export MySQL Database | (bool) |
DatabaseCommands::pg_dump() | Export PostgreSQÖ Database | (null) |