Cilex 是一个基于 Silex 而创建的轻量级框架,用于创建 PHP CLI 脚本
Cilex is a simple command line application framework to develop simple tools based on Symfony2 components:
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.
git clone this repository.curl -s https://getcomposer.org/installer | phpphp composer.phar installsrc/Cilex/Command/bin/run.php./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
curl -LSs https://box-project.github.io/box2/installer.php | php
chmod +x box.phar
mv box.phar /usr/local/bin/box
box build
./cilex.phar demo:greet world
./cilex.phar demo:greet world -y
./cilex.phar demo:greet world --yell
./cilex.phar demo:info
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
暂无开放 Issues,或尚未同步最近议题。