pingu1/packaged-cilex

A packaged version of Cilex Framework with clean project architecture

1.0.3 2017-05-19 15:41 UTC

This package is not auto-updated.

Last update: 2024-04-14 01:57:14 UTC


README

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.

Installation

  1. Download composer: curl -s https://getcomposer.org/installer | php
  2. Create a new project based on this one composer.phar create-project pingu1/packaged-cilex test
  3. Init the Git repository in your new project git init

Usage

  • 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

Bonus

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/"
    }
}

Help and docs

This repository is just a wrapper of the Cilex project, for additional question regarding how to use Cilex, please check the Cilex project