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

Added vendor to phinx path to be aligned with other docs sections #1029

Merged
merged 1 commit into from
Feb 12, 2017

Conversation

derpoho
Copy link

@derpoho derpoho commented Jan 30, 2017

No description provided.

@robmorgan
Copy link
Member

thanks

@robmorgan robmorgan merged commit 2ad5c22 into cakephp:master Feb 12, 2017
@shadowhand
Copy link
Contributor

This is not in agreement with bin-dir configuration.

@rquadling
Copy link
Collaborator

rquadling commented Feb 20, 2017

The content of vendor/bin are shell scripts.

I think the confusion may be coming from developing phinx - in which case the bin directory contains the PHP script - and the composer bin/shell/wrapper - in which case this is only shell scripts to the scripts in the projects bin directory.

So, the documentation should be just vendor/bin/phinx and not php vendor/bin/phinx.

The bin-dir configuration (https://getcomposer.org/doc/articles/vendor-binaries.md) is about what files in the Phinx project need shell scripts generated by composer and thereby accessible via vendor/bin.

If someone is using Phinx outside of composer, then bin/phinx is what the documentation should say. Otherwise vendor/bin/phinx.

Of course, those who are running on Windows will be using \, rather than /.

In both cases, there is no need to put the php interpreter in as the file is shell executable.

On Unix, via composer, vendor/bin/phinx is an executable shell script.
On Unix, not via composer bin/phinx is an executable shell script that uses the PHP interpreter to run - assuming it is installed appropriately.
On Windows, via composer, vendor\bin\phinx.bat is a batch file.
On Windows, not via composer bin\phinx.bat is a batch file.

On Windows the .bat part is ignorable due to the way executable extensions are processed. There is a env var called PATHEXT which is a list of extensions that are deemed executable, so when you run a command (say bin\phinx), then the extensions in PATHEXT are used to help find an executable file in that location. From a unix perspective, Windows eventually runs CMD.EXE /C bin\phinx.bat (sort of).

@derpoho
Copy link
Author

derpoho commented Feb 22, 2017

This commit was only synchronising the states, it was referenced with multiple different paths. That's solved now. I didn't really think about the correct way to reference it on windows or any other variants.

But my 2 cents: It should be vendor/bin/phinx since most users will install via composer, and someone who installs it any other way will either know that the vendor path does not exists or knows what he/she is doing ;)

@rquadling
Copy link
Collaborator

bin/phinx or vendor/bin/phinx (bin\phinx or vendor\bin\phinx for Windows users).

But never php bin/phinx or php vendor/bin/phinx. The php is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants