Respect / Config

A powerful, small, deadly simple configurator and dependency injection container DSL made to be easy
http://respect.github.io/Config
Other
98 stars 7 forks source link

Support PHP magic constants #15

Closed augustohp closed 12 years ago

augustohp commented 12 years ago

DIR for example ...

alganet commented 12 years ago

But these magic constants should point to where? If we just translate them, they would inherit the scope from Instantiator::parseConstants, and __DIR__, __FILE__, __CLASS__ and many others would loss all its meaning.

I believe we should discourage using magic constants in INI files.

augustohp commented 12 years ago

We should discourage but we really need them. There is not much problem with FILE and CLASS, actually there is no need to them as I see it.

But the DIR is needed for paths relative to the application. The first value that comes to mind is the PATH to the dir of the parsed INI file. What do you think?

alganet commented 12 years ago

Can't think of a proper use case for this. Enlighten us please!

augustohp commented 12 years ago

Registering a class path for Doctrine, for instance. It needs a path that is relative to the application, to call the method to register the Entities path I need to create a constant that would not be used in anywhere else but the INI file.

alganet commented 12 years ago

You mean for the annotation driver? Can I see the sample? I believe registering it relative to the include_path should work.