n-coded / php-safe-exec
Run system command safely
Installs: 9 332
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
This package is not auto-updated.
Last update: 2025-06-21 22:04:34 UTC
README
Generate and run shell command safely by escaping option value and argument
Usage:
$command = new SafeExec('unoconv');
$command->addOption('-f', 'pdf');
$command->addOption('-o', 'test.pdf');
$command->addArgument('test.docx');
$command->stdoutToNull();
$command->shell_exec();
or use chaining:
$command = (new SafeExec('unoconv'))->addOption('-f', 'pdf')->addOption('-o', 'test.pdf')->addArgument('test.docx')->stderrToStdout();
$command->exec($output, $return_var);
Donation
Thank you for using and donation http://goo.gl/xdEcN6