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

Add script to vendor/bin folder #330

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

pcurrier
Copy link
Contributor

@pcurrier pcurrier commented May 6, 2020

For projects adding Search-Replace-DB as a dependency, composer will now symlink the script into the bin folder.

Unserialization can produce syntax errors, which are under Error in the
php exception hierarchy.
@gianluigi-icit
Copy link
Contributor

Hello, thanks for the PR!

Is this going to work since that file expects the class in the same directory?

https://github.com/interconnectit/Search-Replace-DB/blob/master/srdb.cli.php#L32

@pcurrier
Copy link
Contributor Author

pcurrier commented May 11, 2020

Yes, it seems to work for me. Composer doesn't copy the file, it just puts a symlink into the vendor/bin folder. Then the require_once() in srdb.cli.php will find the other class since symlinks in __FILE__ are resolved.

I'm not sure what composer does on platforms without symlinks, however.

@gianluigi-icit
Copy link
Contributor

good point! We need a test on windows 😃

@pcurrier
Copy link
Contributor Author

Per the composer docs, on windows it creates a .bat file instead of a symlink:

https://getcomposer.org/doc/articles/vendor-binaries.md#what-about-windows-and-bat-files-

@gianluigi-icit gianluigi-icit merged commit e71e0b2 into interconnectit:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants