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
vendor/bin/doctrine won't work, reporting missing 'doctrine.php' #8563
Comments
Thanks for reporting this, but bear in mind that this script is generated by Composer so even if we (Doctrine) don't need the eval, the fix for that will not happen in However, when I look at the excerpt of code you are showing, it looks like this could be fixed by using #!/usr/bin/env php
<?php
include(__DIR__ . '/doctrine.php'); And then report back? |
Hey @greg0ire, thanks for comming back to me on this. First, I apologize for opening this issue in Doctrine Project, rather than Composer - thought it was part of the Doctrine. And yes, if I do the change like you said, it works. Do you believe this is worth reporting as a some sort of a Bug in Composer ? |
Oh no you're in the right place actually, because as you just proved to yourself it can be fixed here.
Then please send a PR
I'm not sure. When you remove the if block, you said it worked, but doesn't it also print the shebang to the output? |
@greg0ire I believe that the shebang part is only because of fetching the file contents from the But as for the usage of the script, I am not sure if this is necessary at all. We just need the If not, I believe better fix is actually removing all of the |
I was expecting the shebang to be wrongly output, but it looks like it isn't. So maybe you can try reporting that to Composer. |
Will try reaching out. Thanks. With this I believe we can close this issue at Doctrine's site. :) |
I was following the doctrine2-ORM Getting Started Guide (just learning about Doctrine) where I encountered a following issue.
ERROR MESSAGE:
DOCTRINE CODE:
This code returns
include(doctrine.php)
, however, this will of course not work, becausedoctrine.php
is NOT present in the current directory where we are executing thevendor/bin/doctrine
.However, when I commented out the
if block
, the code executed as expected. I assume this works because the$binPath
correctly holds the absolute path to wheredoctrine.php
is present.This raises the question, why do we even do
eval()
in this script block? including the absolute path todoctrine.php
seems to work just nice.The text was updated successfully, but these errors were encountered: