Skip to content

fatalus69/php-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

How to install


How to use

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();

Availabe Calls

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)

About

Run bash commands directly from PHP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages