2017 © Pedro Peláez
 

library cilex

The PHP micro-framework for Command line tools based on the Symfony2 Components

image

cilex/cilex

The PHP micro-framework for Command line tools based on the Symfony2 Components

  • Tuesday, December 13, 2016
  • by mvriel
  • Repository
  • 30 Watchers
  • 625 Stars
  • 1,878,173 Installations
  • PHP
  • 43 Dependents
  • 1 Suggesters
  • 78 Forks
  • 5 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Cilex, a simple Command Line Interface framework

Cilex is a simple command line application framework to develop simple tools based on Symfony2 components:, (*1)

<?php
if (!$loader = include __DIR__.'/vendor/autoload.php') {
    die('You must set up the project dependencies.');
}

$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->command('foo', function ($input, $output) {
    $output->writeln('Example output');
});
$app->run();

Cilex works with PHP 5.5.9 or later and is heavily inspired by the Silex web micro-framework by Fabien Potencier., (*2)

Installation

  1. git clone this repository.
  2. Download composer: curl -s https://getcomposer.org/installer | php
  3. Install Cilex' dependencies: php composer.phar install

Usage

  • Create your new commands in src/Cilex/Command/
  • Add your new commands to bin/run.php
  • Run the commands as:
./bin/run.php demo:greet world
./bin/run.php demo:greet world -y
./bin/run.php demo:greet world --yell
./bin/run.php demo:info

Creating a PHAR

  • Download and install [box][5]:
curl -LSs http://box-project.org/installer.php | php
chmod +x box.phar
mv box.phar /usr/local/bin/box
  • Update the project phar config in box.json
  • Create the package:
box build
  • Run the commands:
./cilex.phar demo:greet world
./cilex.phar demo:greet world -y
./cilex.phar demo:greet world --yell
./cilex.phar demo:info
  • enjoy a lot.

License

Cilex is licensed under the MIT license., (*3)

FAQ

Q: How do I pass configuration into the application?, (*4)

A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:, (*5)

$app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));

The formats currently supported are: YAML, XML and JSON, (*6)

The Versions

13/12 2016

dev-develop

dev-develop http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

20/11 2016

dev-master

9999999-dev http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

20/11 2016

2.0.0

2.0.0.0 http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

29/03 2014

1.x-dev

1.9999999.9999999.9999999-dev http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

29/03 2014

1.1.0

1.1.0.0 http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

01/08 2013

1.0.1

1.0.1.0 http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

04/07 2013

1.0.0

1.0.0.0 http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework

21/11 2012

0.1

0.1.0.0 http://cilex.github.com

The PHP micro-framework for Command line tools based on the Symfony2 Components

  Sources   Download

MIT

The Requires

 

The Development Requires

cli microframework