Download the PHP package phormium/modgen without Composer
On this page you can find all versions of the php package phormium/modgen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package modgen
Phormium Model Generator
Model class generator for Phormium.
ModGen generates classes which extend Phormium\Model from existing database tables. Currently supports MySQL, PostgreSQL, SQLite and Informix.
Installation
PHAR
The simplest way to use ModGen is to download the latest version as a PHAR archive from the releases page on GitHub.
You can now run ModGen:
This is abbreviated to modgen
in the usage examples.
Packagist
You can also install from Packagist using using Composer.
Create a file called composer.json
with the following contents:
Download composer and run:
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.
Creating the PHAR
To compile ModGen into a PHAR, clone the project from GitHub:
Install the dependencies using Composer:
Run the compilation script:
modgen.phar
will be generated in your working directory.
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.
Generate models for all tables in a database:
Generate models for specified tables in a database:
Options:
--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
:
Generate models for tables person
and invoice
in the backoffice
database,
without a namespace:
License
Licensed under the MIT license. See LICENSE.md.