Store the outer filesystem's filename in a constant for later use
This is related to (and required for) https://github.com/wp-cli/wp-cli/pull/5962
This will set an extra constant that stores the outer filesystem's filename. When that filename doesn't match with the phar's internal filename (wp-cli.phar), the phar can't find internal files that use __DIR__ for a reference point to the file.
I don't think this approach is ideal. It is still very hacky and it has issues with multibyte strings in filesystems.
I think this needs to be solved using https://www.php.net/manual/en/phar.running.php in the correct way. I'll have a stab at it...
Went with a different approach => #752
Thanks for looking into this, @johnpbloch !