2017 © Pedro Peláez
 

library modgen

Model class generator for Phormium.

image

phormium/modgen

Model class generator for Phormium.

  • Monday, December 1, 2014
  • by ihabunek
  • Repository
  • 1 Watchers
  • 2 Stars
  • 375 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Phormium Model Generator

Model class generator for Phormium., (*1)

ModGen generates classes which extend Phormium\Model from existing database tables. Currently supports MySQL, PostgreSQL, SQLite and Informix., (*2)

Latest Stable Version Total Downloads Build Status, (*3)

Installation

PHAR

The simplest way to use ModGen is to download the latest version as a PHAR archive from the releases page on GitHub., (*4)

You can now run ModGen:, (*5)

php modgen.phar

This is abbreviated to modgen in the usage examples., (*6)

Packagist

You can also install from Packagist using using Composer., (*7)

Create a file called composer.json with the following contents:, (*8)

{
    "require": {
        "phormium/modgen": "0.*"
    }
}

Download composer and run:, (*9)

php composer.phar install

The script for running modgen will be vendor/bin/modgen for *nix and Mac and vendor\bin\modgen.bat for Windows users. This is abbreviated to modgen in the usage examples., (*10)

Creating the PHAR

To compile ModGen into a PHAR, clone the project from GitHub:, (*11)

git clone https://github.com/ihabunek/phormium-modgen.git

Install the dependencies using Composer:, (*12)

php composer.phar install

Run the compilation script:, (*13)

php bin\compile

modgen.phar will be generated in your working directory., (*14)

Usage

Before starting, you need to have a Phormium configuration file which defines the database from which you want to generate models. If a config file is not specified, modgen will look for a file named "config.json" in the working directory., (*15)

Generate models for all tables in a database:, (*16)

modgen generate [options] <database>

Generate models for specified tables in a database:, (*17)

modgen generate [options] <database> [table1] ... [tableN]

Options:, (*18)

  • --config - Path to the config file. (default: "config.json")
  • --target - Target folder where the model will be generated (defaults to current working directory)
  • --namespace - The PHP namespace used for the model classes. (default: "")
  • --help (-h) - Display the help message.

Examples

Generate models for all tables in backoffice database, using namespace Foo\Bar:, (*19)

modgen --namespace=Foo\Bar backoffice

Generate models for tables person and invoice in the backoffice database, without a namespace:, (*20)

modgen backoffice person invoice

License

Licensed under the MIT license. See LICENSE.md., (*21)

The Versions

01/12 2014

dev-develop

dev-develop https://github.com/ihabunek/phormium-modgen

Model class generator for Phormium.

  Sources   Download

MIT

The Requires

 

The Development Requires

orm database php generator mapping

17/01 2014

dev-master

9999999-dev https://github.com/ihabunek/phormium-modgen

Model class generator for Phormium.

  Sources   Download

MIT

The Requires

 

The Development Requires

orm database php generator mapping

17/01 2014

0.2.1

0.2.1.0 https://github.com/ihabunek/phormium-modgen

Model class generator for Phormium.

  Sources   Download

MIT

The Requires

 

The Development Requires

orm database php generator mapping

17/01 2014

0.2

0.2.0.0 https://github.com/ihabunek/phormium-modgen

Model class generator for Phormium.

  Sources   Download

MIT

The Requires

 

The Development Requires

orm database php generator mapping

15/01 2014

0.1

0.1.0.0 https://github.com/ihabunek/phormium-modgen

Model class generator for Phormium.

  Sources   Download

MIT

The Requires

 

orm database php generator mapping