项目作者: basuke

项目描述 :
PHP Micro framework for command line application inspired by Slim Framework
高级语言: PHP
项目地址: git://github.com/basuke/Clim.git
创建时间: 2017-04-13T04:17:39Z
项目社区:https://github.com/basuke/Clim

开源协议:MIT License

下载


Clim Framework

PHP Micro framework for command line application inspired by Slim Framework

Build Status

Features

  • Simple yet powerful configuration
  • DI Container support
  • Sub command dispatch
  • Middleware support

Install

  1. $ composer require climphp/clim

Usage

After composer install, create an hello.php file with the following contents:

  1. <?php
  2. require 'vendor/autoload.php';
  3. $app = new Clim\App();
  4. $app->opt('-u|--upper');
  5. $app->arg('name')->default('unknown');
  6. $app->task(function ($opts, $args) {
  7. $name = $args['name'];
  8. if ($opts['u']) $name = strtoupper($name);
  9. echo "Welcome, {$name}\n";
  10. });
  11. $app->run();

Then from the shell:

  1. $ php hello.php Nocchi
  2. Welcome, Nocchi
  3. $ php hello.php -u Kashiyuka
  4. Welcome, KASHIYUKA

For more information on how to configure your clie application, see the Documentation.

Tests

To execute the test suite, you’ll need codeception.

  1. $ vendor/bin/codecept run unit

Credits

Special thanks to Slim Framework for the archtecture and the api design.

License

The Clim Framework is licensed under the MIT license. See License File for more information.