box2-lib
box2-lib copied to clipboard
it would be nice if there was a specific define set to detect if your script is running within a phar
Aloha,
basically it would be nice to have some sort of define ("BOX_PHAR".. something like that), which explicitely allows to detect if a script is run from within a phar file.
right now I'm abusing the BOX_EXTRACT_PATTERN_DEFAULT one for that, and that feels like a cheat.
I'll see about adding something like this for the next version of Box.
Currently, the Phar::running()
function should fit the bill if the phar
extension is available.