Parameters token replacement with complex structure #3339

Closed
neoascetic opened this Issue Jul 15, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@neoascetic
Contributor

neoascetic commented Jul 15, 2016

Given settings.yml containing

api:
  db:
    host: 127.0.0.1
    database: db
    username: user
    password: pass

and codeception.yml containing

params:
  - settings.yml

I want acceptance.yml parameters replacement

modules:
  enabled:
    - Db:
        dsn: 'mysql:host=%api.db.host%;dbname=%api.db.database%'
        user: '%api.db.username%'
        password: '%api.db.password%'

resulting in

modules:
  enabled:
    - Db:
        dsn: 'mysql:host=127.0.0.1;dbname=db'
        user: user
        password: pass
@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Jul 20, 2016

Member

@DavertMik This is a feature request for Codeception\Util\Template.

I think that template parsing is not a responsibility of Codeception and it would be better to use a third party template parser. However the last template engine I have used was Smarty 1.x so I can't recommend anything.

Member

Naktibalda commented Jul 20, 2016

@DavertMik This is a feature request for Codeception\Util\Template.

I think that template parsing is not a responsibility of Codeception and it would be better to use a third party template parser. However the last template engine I have used was Smarty 1.x so I can't recommend anything.

@neoascetic

This comment has been minimized.

Show comment
Hide comment
@neoascetic

neoascetic Jul 20, 2016

Contributor

Furthermore, import statements for Symphony configs don't work.

Contributor

neoascetic commented Jul 20, 2016

Furthermore, import statements for Symphony configs don't work.

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Jul 20, 2016

Member

@neoascetic Please report it as a separate issue

Member

Naktibalda commented Jul 20, 2016

@neoascetic Please report it as a separate issue

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Jul 22, 2016

Member

import statements for Symphony configs don't work.

yes. They are not. They are not part of yaml format, actually.

@neoascetic could you look into Codeception\Util\Template and provide a patch so it could use arrays with dots as parameters? I don't think that would be hard to implement this. Thanks

Member

DavertMik commented Jul 22, 2016

import statements for Symphony configs don't work.

yes. They are not. They are not part of yaml format, actually.

@neoascetic could you look into Codeception\Util\Template and provide a patch so it could use arrays with dots as parameters? I don't think that would be hard to implement this. Thanks

@neoascetic

This comment has been minimized.

Show comment
Hide comment
@neoascetic

neoascetic Jul 26, 2016

Contributor

yes. They are not. They are not part of yaml format, actually.

I know that, but docs are saying about "Symfony format" and fact that import statement isn't supported is a little bit misleading

Contributor

neoascetic commented Jul 26, 2016

yes. They are not. They are not part of yaml format, actually.

I know that, but docs are saying about "Symfony format" and fact that import statement isn't supported is a little bit misleading

neoascetic added a commit to neoascetic/Codeception that referenced this issue Jul 26, 2016

neoascetic added a commit to neoascetic/Codeception that referenced this issue Jul 26, 2016

neoascetic added a commit to neoascetic/Codeception that referenced this issue Jul 26, 2016

Naktibalda added a commit that referenced this issue Jul 28, 2016

Merge pull request #3373 from neoascetic/complex-params-replacing
Dot notation for params replacement. Fixes #3339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment