phamviet / command-builder
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/phamviet/command-builder
Requires
- symfony/process: ~2.7
This package is auto-updated.
Last update: 2025-10-16 21:17:40 UTC
README
** Example
$which = new Which('node');
$which->setEnvironment('PATH', '/usr/bin:/usr/local/bin');
*** SSH
$sshOptions = [
    'StrictHostKeyChecking' => 'false',
    'UserKnownHostsFile'    => '/home/user/.ssh/custom_known_hosts',
];
$ssh = new Ssh();
$ssh->setIdentity('/home/user/.ssh/custom_id_rsa');
$ssh->setOptions($sshOptions);
*** GIT
$git = new Git('clone');
$git
    ->setRepository('git@github.com:phamviet/command-builder.git')
    ->cloneTo("/home/user/public_html")
    ->setEnvironment('GIT_SSH_COMMAND', $ssh);
$git = new Git('pull');
$git->setEnvironment('GIT_SSH_COMMAND', $ssh);
$git->run('/Users/viet/www/himmag');
*** MYSQL
$mysql = new Mysql();
$mysql
    ->setUser('user')
    ->setPassword('password')
    ->setDatabase('db_name')
    ->setFromFile('/path/to/restore/db.sql');
*** RSYNC
$rsync = new Rsync();
$rsync
    ->setOption('avz')
    ->setSsh($ssh);
$rsync
    ->setSource('source')
    ->setTarget('target');
*** du
Du::getSize('/path');