Re: Euphoria MVC updates

new topic     » goto parent     » topic index » view thread      » older message » newer message

I overhauled mvc/config.e today.

https://github.com/OpenEuphoria/euphoria-mvc/releases/tag/v1.13.0

If your configuration looks like this:

# app.cfg 
[database] 
name = mydatabase 
username = dbuser 
password = abc123 
host = db1.example.com 

You can load it in your app like this:

include mvc/config.e 
include mvc/logger.e 
 
if not load_config( "app.cfg" ) then 
    log_crash( "Failed to load configuration" ) 
end if 
 
sequence db_host, db_name, db_user, db_pass 
db_host = get_config( "database.host" ) 
db_name = get_config( "database.name" ) 
db_user = get_config( "database.username" ) 
db_pass = get_config( "database.password" ) 

And it will even preserve comments when saving!

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu