2017 © Pedro Peláez
 

library cli

For build cli applications.

image

fenzland/cli

For build cli applications.

  • Sunday, April 15, 2018
  • by Fenzland
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PHP CLI

A PHP CLI support library., (*1)

Basic Usage

1. Improt library by composer.

composer require fenzland/cli
require PROJECT_PATH.'/vendor/autoload.php';

2. Build your commands.

class FooCmd extends \Fenzland\CLI\ACmd
{
    protected function main( \Fenzland\CLI\IArgs$args ):int
    {
        # TODO code of your command.
    }
}

3. Build your cli entry.

PlanA: To run a single command.
vim foo.php
#!/usr/bin/env php
<?php

require PROJECT_PATH.'/vendor/autoload.php';

$cmd= new FooCmd;

exit( $cmd->run( $argv ) );
chmod +x foo.php
PlanB: To run dozens of commands.
vim app.php
#!/usr/bin/env php
<?php

require PROJECT_PATH.'/vendor/autoload.php';

$app= new \Fenzland\CLI\App;

$app->regCmd( 'foo', FooCmd::class );
$app->regCmd( 'bar', BarCmd::class );
# ...

exit( $app->run( $argv ) );
chmod +x app.php

The Versions

15/04 2018

dev-master

9999999-dev

For build cli applications.

  Sources   Download

MIT

The Requires

 

by Avatar Fenzland

15/04 2018

0.2.0

0.2.0.0

For build cli applications.

  Sources   Download

MIT

The Requires

 

by Avatar Fenzland

27/02 2018

dev-dev

dev-dev

For build cli applications.

  Sources   Download

MIT

The Requires

 

by Avatar Fenzland

27/02 2018

0.1.0

0.1.0.0

For build cli applications.

  Sources   Download

MIT

The Requires

 

by Avatar Fenzland