Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symlink functions disable causing problems #7873

Closed
evalor opened this Issue Jan 4, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@evalor
Copy link

commented Jan 4, 2019

$result = @symlink($relativePath, $link);

Thank you very much for your attention. Because my English level is limited, I use Google Translator. If there are mistakes, please forgive me.

On linux and macos, when I disable the function symlink in php.ini, composer will not be able to create symbolic links in the PHP script, then the function installUnixyProxyBinaries will be called, which will create one proxy script for " Cgywin" environment.

In fact, I am not currently in the "Cgywin" environment, so this proxy script does not work properly on my machine.

dir=$(d=${0%[/\\]*}; cd "$d" > /dev/null; cd '../easyswoole/easyswoole/bin' && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
    # Cygwin paths start with /cygdrive/ which will break windows PHP,
    # so we need to translate the dir path to windows format. However
    # we could be using cygwin PHP which does not require this, so we
    # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
    if [[ $(which php) == /cygdrive/* ]]; then
        dir=$(cygpath -m "$dir");
    fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/easyswoole" "$@"

Is this a normal phenomenon? Besides lifting the disable, how can I solve this problem?

@alcohol

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

I think you misread the file or simply do not understand the purpose of it. It is a proxy file that works on regular unix and linux environments. On cygwin it needs an extra tweak to work. It is not only for cygwin.

this proxy script does not work properly on my machine

If you do not tell us what is actually wrong, we cannot help you. Saying that "it does not work" is not very helpful information for us.

@alcohol alcohol added the Support label Jan 9, 2019

@evalor

This comment has been minimized.

Copy link
Author

commented Jan 15, 2019

Maybe I misunderstood the role of the script. Suppose I have a script file called 'launcher' , when I installed the package, his path is located vendor/bin/launcher, I tried to use it as a php script, so I execute the following command php vendor/bin/launcher arg1 arg2 or require it in another php script file, like this:

<?php require './vendor/bin/launcher';

This will directly read the contents of the file and output it, not executing, can I get the correct usage?

@stof

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

bin scripts are not meant to be required by PHP. They are meant to be called as executables (so vendor/bin/launcher arg1 arg2)

@stof

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

there is strictly no guarantee in composer that the executable script in vendor/bin is a PHP script. It can be any executable script (and in the case of creating a proxy file, the proxy file is not written in PHP as writing it using sh is much more efficient).

@alcohol alcohol closed this Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.