PHP code example of phore / cli-tools
1. Go to this page and download the library: Download phore/cli-tools 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/ */
phore / cli-tools example snippets
class MainCmd extends PhoreAbstractMainCmd
{
public function invoke(CliContext $context)
{
$opts = $context->getOpts("i:");
$context->dispatchMap([
"import" => new ImportCmd(),
"search" => new SearchCmd()
], $opts);
}
}
class SearchCmd extends PhoreAbstractCmd
{
public function invoke(CliContext $context)
{
$opts = $context->getOpts();
$context->ask("Do you want to continue?");
}
}