Cilex is a simple command line application framework to develop simple tools based on Symfony2 components:
<?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->run();
Cilex works with PHP 5.3.3 or later and is heavily inspired on the Silex web micro-framework by Fabien Potencier.
git clone
this repository.- Download composer:
curl -s https://getcomposer.org/installer | php
- Install Cilex' dependencies:
php composer.phar install
- Download composer:
curl -s https://getcomposer.org/installer | php
- Add to your dependencies:
php composer.phar require cilex/cilex dev-master
- Update the dependencies
- Create a
run.php
file
<?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->run();
php run.php
- enjoy a lot.
Cilex is licensed under the MIT license.
Q: How do I pass configuration into the application?
A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:
$app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));
The formats currently supported are: YAML, XML and JSON