Cilex is a simple command line application framework to develop simple tools based on Symfony2 components. However, creating an application with Cilex requires to add your source code at the same level as the package source code, which is not really desirable when dealing with code updates. This version is embedding Cilex as a dependency in order to fully isolate your own code.
- Download composer:
curl -s https://getcomposer.org/installer | php
- Create a new project based on this one
composer.phar create-project pingu1/packaged-cilex test
- Init the Git repository in your new project
git init
- Put your code in the
src/command/
folder - Add additional directories as needed (
src/model/
,src/helper/
,src/library/
...) - Add your scripts to the
cilex
entry point (located at the root of the project)
$app->command(new \app\command\YourNamespaceHere());
- Run the script
./cilex hello
./cilex hello -h
./cilex hello renaud
./cilex hello renaud -y
./cilex hello renaud --yell
You can easily update the composer.json file to give another namespace than app
to the application by updating the autoloader as follows:
"autoload": {
"psr-4": {
"YOUR_APP_NAME_HERE\\": "src/"
}
}
This repository is just a wrapper of the Cilex project, for additional question regarding how to use Cilex, please check the Cilex project