Download the PHP package pomm-project/cli without Composer
On this page you can find all versions of the php package pomm-project/cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pomm-project/cli
More information about pomm-project/cli
Files in pomm-project/cli
Package cli
Short Description Command line for Pomm.
License MIT
Homepage http://www.pomm-project.org
Informations about the package cli
Cli
This is the Cli component for the Pomm database framework.
Configuration
Pomm's Cli is independent from one's development environment, it does not know what configuration types and files are used in the project. To make the Cli work, it is necessary to create a plain PHP bootstrap file that returns a Pomm instance. By default it is named .pomm_cli_bootstrap.php
. If the project already has a script that returns a configured Pomm instance, it is possible to specify it to the Cli using the option -b|--bootstrap-file="..."
.
Database inspection
The inspect
command uses the Foundation.Inspector
to display information about the database structure.
- pomm:inspect:database - Get schemas in a database.
- pomm:inspect:schema - Get relations information in a schema.
- pomm:inspect:relation - Get information about a relation.
Code generation
The generate
commands create PHP class for use of database relations with Pomm's ModelManager package.
- pomm:generate:structure - Generate a RowStructure class according to the relation structure.
- pomm:generate:model - Generate a new configured Model class.
- pomm:generate:entity - Generate an empty FlexibleEntity class.
- pomm:generate:relation-all - Generate the 3 files above for the given relation.
- pomm:generate:schema-all - Generate the 3 files above for every relation in the given schema.
Since you are going to add your own methods in the generated Model and FlexibleEntity classes, they will NOT be overwritten by default by the generate
commands. It is somehow possible to do so by implicitly specifying the option --force
. All the code in the overwritten classes will then be lost and replaced by a brand new class. Structure files are always overwritten without prior asking for confirmation. To avoid mixing these two kinds of classes, Structure classes are saved under a AutoStructure
subdirectory.
Prefixes options
By default, Pomm's ModelManager expects at least the classes to be saved using the following namespaces: DatabaseConfigName\SchemaSchema
. It is possible to tell the Cli where this structure starts and how to tune it.
--prefix-dir
,-d
- indicates where to start the Namespace directory tree.--prefix-ns
,-a
- indicates an optional namespace prefix.
When no options are specified, generating all relations of public schema will act like the following:
It is often not a good idea to have the model's namespace starting at project's root directory. Most of the time, it is put in a Model
namespace under sources/lib
directory:
All versions of cli with dependencies
ext-pgsql Version *
psr/log Version ~1.0
pomm-project/foundation Version ~2.0
pomm-project/model-manager Version ~2.0
symfony/console Version ~2.5|~3.0|~4.0|~5.0