php - How to handle Propel environment variables -


i trying setup configuration unit-testing application. therefore need setup different database connections. have tried follow documentation (environment variables doc) don't understand save environment variables can found when have like:

dsn: "mysql:host=%env%;dbname=%env%" 

in propel.yaml file.

google not provide solutions, searching here.

the documentation says have write them in file.. where?

can me please?

env vars

when using linux can set environment vars this:

$ export db_host="localhost"  $ export db_name="dbname" ... 

thus can grab vars php this:

$ php -r 'var_dump($_env["db_name"]);' 

or:

$ php -r 'var_dump(getenv["db_name"]);' 

in order set env vars on windows follow link: how create environmental variable windows 7

propel

on propel, must set parameters (propel.yaml file):

propel:   database:       connections:           default:               adapter: mysql               classname: propel\runtime\connection\debugpdo               dsn: mysql:host=%env.db_host%;dbname=%env.db_name% 

and here goes helpful links:


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -