theseer / Autoload

A lightweight php namespace aware autoload generator and phar archive builder
Other
388 stars 47 forks source link

Add support for parent templates #16

Closed sebastianbergmann closed 13 years ago

sebastianbergmann commented 13 years ago

It would be nice if PHPAB supported an additional switch along the lines of --parent <file> that would result in

require '<file>';

to be added at the top of the generated code.

This would add out-of-the-box support for situations where you want to have one autoload script generated for the src directory and another for the tests directory of a project and the latter has to load the former.

theseer commented 13 years ago

I've spent some time considering that option which on first glance sounds like a really good idea - until you think about how to implement it. It would probably make more sense to make the variable option within the library available on the CLI so you can define custom values to be used in the templates. That of course would still require you to use a custom template to have the appropriate placeholders... If you like that idea, feel free to open a new ticket on it, i'll be closing this one.

theseer commented 13 years ago

Nevermind, already implemented it. Going to be in the next release.