Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Propel sample configuration file
## Sample Propel configuration file ##
propel:
## General settings ##
general:
# The name of your project.
# This affects names of generated files, etc.
project:
version: 2.0.0-dev
### Directories and Filenames ###
paths:
# Directory where the project files (`schema.xml`, etc.) are located.
# Default value is current path #
projectDir: current_path
# The directory where Propel expects to find your `schema.xml` file.
schemaDir: current-path
# The directory where Propel should output classes, sql, config, etc.
# Default value is current path #
outputDir: current-path
# The directory where Propel should output generated object model classes.
phpDir: current-path/generated-classes
# The directory where Propel should output the compiled runtime configuration.
phpConfDir: current-path/generated-conf
# The directory where Propel should output the generated DDL (or data insert statements, etc.)
sqlDir: current-path/generated-sql
# Directory in which your composer.json resides
composerDir:
## All Database settings ##
#
# This section replaces the old runtime-conf.xml file and it's also used by config:convert command
database:
# All database sources
connections:
default:
adapter:
# Connection class. While developing you could use Propel\Runtime\Connection\DebugPDO
classname: Propel\Runtime\Connection\ConnectionWrapper
dsn:
user:
password:
# Driver options. See http://www.php.net/manual/en/pdo.construct.php
# options must be passed to the contructor of the connection object
options:
# See http://www.php.net/manual/en/pdo.getattribute.php
# Attributes are set via `setAttribute()` method, after the connection object is created
attributes:
#Propel specific settings
settings:
charset: utf8
#Array of queries to run when the database connection is initialized
queries:
- "SELECT * FROM myTable"
- "Update logs SET ....."
#example of master-slave connection
master-slave:
adapter: mysql
classname: Propel\Runtime\Connection\DebugPdo
dsn: mysql:host=localhost;dbname=mydb
user: prettyuser
password: prettypwd
options:
attributes:
slaves:
- dsn: mysql:host=slave-host-1;dbname=bookstore
- dsn: mysql:host=slave-host-2;dbname=bookstore
- dsn: mysql:host=slave-host-3;dbname=bookstore
## Specific adapter settings
adapters:
## Mysql ##
mysql:
tableType: InnoDB
tableEngineKeyword: ENGINE
## Sqlite ##
sqlite:
foreigKey:
tableAlteringWorkaround:
## Oracle ##
oracle:
autoincrementSequencePattern: ${table}_SEQ
## Migration settings ##
migrations:
samePhpName: false
addVendorInfo: false
tableName: propel_migration
parserClass:
## Reverse settings
reverse:
# The connection to use to reverse the database
connection: default
# Reverse parser class can be different from migration one
parserClass:
## Runtime settings ##
runtime:
defaultConnection: default
# Datasources as defined in database.connections
connections:
- default
## Log and loggers definitions ##
# For `type` and `level` options see Monolog documentation https://github.com/Seldaek/monolog
log:
defaultLogger:
type:
path:
level:
## Profiler configuration ##
# To enable the profiler for a connection, set the `classname` option to \Propel\Runtime\Connection\ProfilerConnectionWrapper
# see: http://propelorm.org/documentation/07-logging.html
profiler:
classname: \Propel\Runtime\Util\Profiler
slowTreshold: 0.1
details:
time:
precision: 3
pad: 8
memory:
precision: 3
pad: 8
memDelta:
precision: 3
pad: 8
memPeak:
precision: 3
pad: 8
innerGlue: ":"
outerGlue: "|"
## Generator settings ##
generator:
defaultConnection: default
# Datasources as defined in database.connections
connections:
- default
# A prefix to prepend to all table names
tablePrefix:
# Platform class name
platformClass:
# The package to use for the generated classes.
# This affects the value of the @package phpdoc tag, and it also affects
# the directory that the classes are placed in. By default this will be
# the same as the project. Note that the target package (and thus the target
# directory for generated classes) can be overridden in each `<database>` and
# `<table>` element in the XML schema.
#
# DEPRECATED ? (this was used back in th 80's with php5.2)
targetPackage:
# Whether to join schemas using the same database name into a single schema.
# This allows splitting schemas in packages, and referencing tables in another
# schema (but in the same database) in a foreign key. Beware that database
# behaviors will also be joined when this parameter is set to true.
packageObjectModel: true
# If you use namespaces in your schemas, this setting tells Propel to use the
# namespace attribute for the package. Consequently, the namespace attribute
# will also stipulate the subdirectory in which model classes get generated.
namespaceAutoPackage: true
schema:
# The schema base name
basename: schema
# If your XML schema specifies SQL schemas for each table, you can copy the
# value of the `schema` attribute to other attributes.
# To copy the schema attribute to the package attribute, set this to true
autoPackage: false
# To copy the schema attribute to the namespace attribute, set this to true
autoNamespace: false
# To use the schema attribute as a prefix to all model phpNames, set this to true
autoPrefix: false
# Whether to transform the XML schema using the XSL file.
# This was used in previous Propel versions to clean up the schema, but tended
# to hide problems in the schema. It is disabled by default since Propel 1.5.
# The default XSL file is located under `resources/xsl/database.xsl`
# and you can use a custom XSL file by changing the `propel.schema.xsl.file`
# property.
transform: false
## Date/Time settings ##
dateTime:
# Enable full use of the DateTime class.
# Setting this to true means that getter methods for date/time/timestamp
# columns will return a DateTime object when the default format is empty.
useDateTimeClass: true
# Specify a custom DateTime subclass that you wish to have Propel use
# for temporal values.
dateTimeClass: DateTime
# These are the default formats that will be used when fetching values from
# temporal columns in Propel. You can always specify these when calling the
# methods directly, but for methods like getByName() it is nice to change
# the defaults.
# To have these methods return DateTime objects instead, you should set these
# to empty values
defaultTimeStampFormat: Y-m-d H:i:s
defaultTimeFormat:
defaultDateFormat:
objectModel:
# Whether to add generic getter/setter methods.
# Generic accessors are `getByName()`, `getByPosition(), ` and `toArray()`.
addGenericAccessors: true
# Generic mutators are `setByName()`, `setByPosition()`, and `fromArray()`.
addGenericMutators: true
emulateForeignKeyConstraints: false
addClassLevelComment: true
defaultKeyType: phpName
addSaveMethod: true
namespaceMap: Map
# Whether to add a timestamp to the phpdoc header of generated OM classes.
# If you use a versioning system, don't set this to true, or the classes
# will be committed too often with just a date change.
addTimeStamp: false
# Whether to support pre- and post- hooks on `save()` and `delete()` methods.
# Set to false if you never use these hooks for a small speed boost.
addHooks: true
# Some sort of "namespacing": All Propel classes with get the Prefix
# "My_ORM_Prefix_" just like "My_ORM_Prefix_BookTableMap".
# DEPRECATED ?
classPrefix:
# Identifier quoting may result in undesired behavior (especially in Postgres),
# it can be disabled in DDL by setting this property to true in your build.properties file.
disableIdentifierQuoting: false
# Whether the generated `doSelectJoin*()` methods use LEFT JOIN or INNER JOIN
# (see ticket:491 and ticket:588 to understand more about why this might be
# important).
useLeftJoinsInDoJoinMethods: true
# Pluralizer class (used to generate plural forms)
pluralizerClass: \Propel\Common\Pluralizer\StandardEnglishPluralizer
# Use StandardEnglishPluralizer instead of DefaultEnglishPluralizer for better pluralization
# (Handles uncountable and irregular nouns)
# Builder classes
builders:
object: \Propel\Generator\Builder\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.