box2-lib icon indicating copy to clipboard operation
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

Open ppetermann opened this issue 10 years ago • 1 comments

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.

ppetermann avatar Jan 14 '15 09:01 ppetermann

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.

kherge avatar May 22 '15 16:05 kherge