PHP Classes

File: examples/Complete/app

Recommend this page to a friend!
  Classes of Andrey Postal   EasyCLI   examples/Complete/app   Download  
File: examples/Complete/app
Role: Example script
Content type: text/plain
Description: Example script
Class: EasyCLI
Create CLI applications using handler functions
Author: By
Last change:
Date: 4 months ago
Size: 486 bytes
 

Contents

Class file image Download
<?php
namespace Andrey\Cli\Examples\Complete;

use
Exception;
use
InvalidArgumentException;

use
Andrey\Cli\App;


use
Andrey\Cli\Types\ConsoleLevel;

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

try {
   
$app = new MyCommand();
   
$app->run($argv);
} catch (
InvalidArgumentException $e) {
   
App::console($e->getMessage(), ConsoleLevel::ERROR);
} catch (
Exception $e) {
   
App::console($e->getMessage(), ConsoleLevel::ERROR);
   
App::console(print_r($e, true), ConsoleLevel::ERROR);
}