PHP code example of azurre / php-cli-builder

1. Go to this page and download the library: Download azurre/php-cli-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

azurre / php-cli-builder example snippets



use \Azurre\Component\Cli\Cmd;
$cmd = new Cmd('/usr/bin/rsync');
$cmd
    ->addOption('avz')
    ->addLongParameter('password-file', '/path/to/password file')
    ->addArgument('/path/to/source')
    ->addArgument('rsync://user@host:/destination/path');

echo (string)$cmd;

use \Azurre\Component\Cli\Cmd;
$cmd = Cmd::create('/usr/bin/tar')
    ->addLongOption('create')
    ->addLongOption('dereference')
    ->addLongOption('absolute-names')
    ->addLongParameter('files-from', '/path/to/list')
    ->stdErrTo('/path/to/std-errors');
echo (string)$cmd;

use \Azurre\Component\Cli\Cmd;
$cmd = Cmd::create('/usr/bin/7za')
    ->setParameterSeparator('')
    ->addOption('bd')
    ->addOption('mx7')
    ->addParameter('si', 'test.tar')
    ->addArgument('a')
    ->addArgument('/path/to/test.tar.7z')
    ->stdErrTo(Cmd::TO_STDOUT)
    ->stdOutTo(Cmd::TO_NULL);
echo (string)$cmd;
bash
composer