propelorm/Propel2 — Issue #53: [RFC] Add Console (Symfony2 Component) to replace Phing
Author: willdurand
Created: 2011-11-17 09:47:10+00:00
State: open
Labels: Generator, RFC

Hi there,

I'm currently looking for removing Phing stuffs by introducing the Console component. And here are some ideas to discuss.

### build.properties

First, I wonder how to deal with build properties.

- Do we need to parse `build.properties` file ?
- Will we keep this file ?

IMO we cannot convert all build properties into console parameters, I just don't imagine what we'll need to type to build model classes… The runtime as an XML file for the configuration.

So, we may use a `generator-conf.xml` to replace the `build.properties` existing file. That way, a command will load configurations from these XML files.

### How to name the script ?

Another thing I would like to discuss is the name of the script. I suggest we call the console `propel`, that way we'll call it by running `./bin/propel` or `php bin/propel`. Anyway, it's not important.
_Doctrine puts it in the PATH to get a working `doctrine` command available everywhere (configured through PEAR)._

### Grouping commands

Build stuffs:

* `build:model`
* `build:sql`

Migrations:

* `migration:up`
* `migration:down`
* `migration:status`
* `migration:migrate [--up] [--down]` // kind of alias

SQL:

* `sql:insert`
* `sql:diff`

Data:

* `data:dump`
* `data:sql`

Reverse:

* `schema:reverse`

Tools:

* `tool:convert-conf`
* `tool:graphviz`

### Usage

```
// will build the model for the current directory
./bin/propel build:model

// will build the model into /path/to/project
./bin/propel build:model --dir=/path/to/project
```

As usual, suggestions? Comments? Ideas?

William