wp-cli / wp-cli-bundle

📦 WP-CLI package that bundles the framework with a set of common commands
MIT License
84 stars 30 forks source link

Store the outer filesystem's filename in a constant for later use #649

Open johnpbloch opened 2 months ago

johnpbloch commented 2 months ago

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.

schlessera commented 1 month ago

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...