Skip to content

Composer scripts invoking PHIVE Phars don't run on Windows #479

@JakeQZ

Description

@JakeQZ

With copy=false in phars.xml, the Phars are installed globally in the user account, with a batch file (*.bat) placed in the .phive directory (named e.g. php-cs-fixer.bat not php-cs-fixer.phar). The script currently invokes the PHP executable with the Phar filename explicitly with the *.phar extension. Even if the extension was removed, PHP cannot open Windows batch files.

There are two possible solutions:

  • Change to copy=true in phars.xml
    • This potentially occupies more disk space, if they could be shared between projects (or copies of a single project);
  • Remove php and the file extension from the script command (e.g. so that @php ./.phive/php-cs-fixer.phar becomes \"./.phive/php-cs-fixer\", with the backslashes escaping the quotes for Composer
    • This is what we did in Emogrifier;
    • If the OS won't implicitly execute a file with an extension given a name without it, that could be an issue, but perhaps PHIVE creates an extensionless file to chain on to the Phar to cover that base.

Metadata

Metadata

Assignees

Labels

bugdeveloper-specificIssues that only affect maintainers, contributors, and people submitting PRs

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions