PHP code example of magic-push / cli-toolkit

1. Go to this page and download the library: Download magic-push/cli-toolkit 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/ */

    

magic-push / cli-toolkit example snippets


// Configure your script parameters
$request = Parametizer::newConfig()
    ->newArgument('chunk-size') // A positioned parameter.
    ->newFlag('--dry-run') // A named boolean parameter.

    ->run();

// Read parameters
$chunkSize = $request->getParamAsInt('chunk-size');

// Process...

if (!$request->getParamAsBool('dry-run')) {
    // Make data changes.
}

$request = Parametizer::newConfig()
    ->newArgument('chunk-size')
    ->default(100)
    ->
shell
php tools/cli-toolkit/run.php cli-toolkit:generate:launcher-skeleton
shell
  php tools/cli-toolkit/run.php cli-toolkit:generate:completion-script \
      --search-directory-recursive=tools/cli-toolkit \
      --verbose
  
shell
  php tools/cli-toolkit/run.php cli-toolkit:generate:completion-script --help