You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zippy tries to find zip, unzip and other external executable files using the class Symfony\Component\Process\ExecutableFinder provided by the symfony/process package.
This class searches the provided name in the directories set in the PATH environment variable. On Windows it also tries to add the file extensions that are registered in the PATHEXT environment variable as "executable" extensions (.exe, .com, .cmd, .bat a.s.o). This means that if it tries to find zip on Windows it may return (with full path) some zip.cmd or zip.bat that is present in path.
And this is how it should work.
Unfortunately, the path returned by ExecutableFinder::find() is then checked by Zippy using the PHP function is_executable() that returns TRUE only for valid executable files whose extension is .exe.
This makes impossible using zip.cmd or zip.bat instead of zip.exe even if they are in path and are perfectly valid executable files.
I suggest using is_executable() only when the operating system is not Windows.
As a side note, any file whose extension is recorded in the Windows registry with the verb open is "executable" on Windows. It can be open using the associated program by double-clicking it on Windows Explorer, by using the "start" command in a Command Prompt or by passing it as the first argument ($command or $cmd) to any PHP function that launches another program (system(), exec(), shell_exec(), proc_open() etc).
The text was updated successfully, but these errors were encountered:
Zippy tries to find
zip
,unzip
and other external executable files using the classSymfony\Component\Process\ExecutableFinder
provided by thesymfony/process
package.This class searches the provided name in the directories set in the
PATH
environment variable. On Windows it also tries to add the file extensions that are registered in thePATHEXT
environment variable as "executable" extensions (.exe
,.com
,.cmd
,.bat
a.s.o). This means that if it tries to findzip
on Windows it may return (with full path) somezip.cmd
orzip.bat
that is present in path.And this is how it should work.
Unfortunately, the path returned by
ExecutableFinder::find()
is then checked by Zippy using the PHP functionis_executable()
that returnsTRUE
only for valid executable files whose extension is.exe
.This makes impossible using
zip.cmd
orzip.bat
instead ofzip.exe
even if they are in path and are perfectly valid executable files.I suggest using
is_executable()
only when the operating system is not Windows.As a side note, any file whose extension is recorded in the Windows registry with the verb
open
is "executable" on Windows. It can be open using the associated program by double-clicking it on Windows Explorer, by using the "start" command in a Command Prompt or by passing it as the first argument ($command
or$cmd
) to any PHP function that launches another program (system()
,exec()
,shell_exec()
,proc_open()
etc).The text was updated successfully, but these errors were encountered: