Composer post-install-cmd php script doesn't wait for input

So I have a console script i want run after composer has run an install.

"scripts": { "post-install-cmd": [ "php vendor/bin/setup.php" ]
}

my setup.php is a CLI script that now looks like

<?php echo "something: "; $foo = trim(fgets(STDIN)); echo "you said " . $foo;
?>

When I run php vendor/bin/setup.php manually form the command line - no problems. As expected. However when I run composer install the file executes but STDIN does not wait for a response.

4 Related questions 12 How to fix error of composer post-install-cmd script? 0 Installing composer dependencies from a script 0 Composer skips prompt in scripts Related questions 12 How to fix error of composer post-install-cmd script? 0 Installing composer dependencies from a script 0 Composer skips prompt in scripts 1 Composer post-install-cmd not running with git hook 1 Composer install hangs at ScriptHandler::buildBootstrap 0 Composer auto-load fails inside post-install script 18 Composer unable to run post install script 3 Interactive PHP script with composer 1 How can I run composer post-install command in background? 2 "composer install" invokes post-update-cmd instead of post-install-cmd Load 7 more related questions Show fewer related questions Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like