preaction / Beam-Wire

A simple configuration and dependency injection container
Other
11 stars 10 forks source link

Add method to build a path relative to the config file #36

Open preaction opened 9 years ago

preaction commented 9 years ago

A lot of things need paths. Those paths should be able to be relative to the config file.

I'm thinking something like:

logger:
    class: Log::Dispatch
    args:
        - File
        - filename
        - { $file: var/log/mylog }

and/or

log_dir:
    path: var/log
logger:
    class: Log::Dispatch
    args:
        - File
        - filename
        - { $ref: log_dir }

This helps make a generic way of building paths, pulling out the special way that child containers do it.

preaction commented 9 years ago

It has to be $file because $path is already take up for Data::DPath