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 statically
use fatalus\PhpShell\SystemCommands;
SystemCommands::whoami();
use fatalus\PhpShell\UtilityCommands;
UtilityCommands::stat(__DIR__.DIRECTORY_SEPERATOR.'README.md')
Call | Description | Return Type |
---|---|---|
Utility Commands | ||
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) |
UtilityCommands::stat() | Display detailed file information | (array) |
System Commands | ||
SystemCommands::which() | Returns the executable path of given program | (bool | string) |
SystemCommands::whence() | Returns the executable path of given program | (bool | string) |
SystemCommands::whoami() | Returns the current user | (string) |
SystemCommands::uptime() | Show system uptime | (string) |
SystemCommands::hostname() | Show System hostname | (string) |
Database Commands | ||
DatabaseCommands::mysqldump() | Export MySQL Database | (bool) |
DatabaseCommands::pg_dump() | Export PostgreSQL Database | (null) |