zendframework/zf2 — pull request #6247 by tldev (2014-05-09 01:26:55+00:00)
Title: Added new base path option specifically for console

I'm currently implementing something similar in my application, and thought maybe you guys would like the idea.

Basically, for normal http requests, I want to always fallback to using the request object, for both development and production, but for console, I want to explicitly set the base_path. I need the basePath view helper on a console request so I can send emails via cronjob with the correct urls to my application. If I set the base_path with how the factory currently works, I have to now worry about setting the correct base_path no matter what the application environment is even though the request object works perfectly fine.