Skip to content

Exception when tput not found [Document ncurses dependency] #273

Closed
@dhampik

Description

@dhampik

php:7.4.8-fpm-alpine3.12 docker image does not have ncurses (and thus tput command) installed by default. That causes the following error when running phive:

phive install
PHP Fatal error:  Uncaught PharIo\Phive\EnvironmentException: Command tput not found in phar:///usr/local/bin/phive/src/shared/environment/Environment.php:30
Stack trace:
#0 phar:///usr/local/bin/phive/src/shared/environment/UnixoidEnvironment.php(51): PharIo\Phive\Environment->getPathToCommand('tput')
#1 phar:///usr/local/bin/phive/src/shared/cli/output/OutputLocator.php(16): PharIo\Phive\UnixoidEnvironment->supportsColoredOutput()
#2 phar:///usr/local/bin/phive/src/Factory.php(199): PharIo\Phive\Cli\OutputLocator->getOutput(Object(PharIo\Phive\UnixoidEnvironment), true)
#3 phar:///usr/local/bin/phive/src/Factory.php(32): PharIo\Phive\Factory->getOutput()
#4 /usr/local/bin/phive(349): PharIo\Phive\Factory->getRunner()
#5 {main}
  thrown in phar:///usr/local/bin/phive/src/shared/environment/Environment.php on line 30

Fatal error: Uncaught PharIo\Phive\EnvironmentException: Command tput not found in phar:///usr/local/bin/phive/src/shared/environment/Environment.php on line 30

PharIo\Phive\EnvironmentException: Command tput not found in phar:///usr/local/bin/phive/src/shared/environment/Environment.php on line 30

Call Stack:
    0.0017     457912   1. {main}() /usr/local/bin/phive:0
    0.0112     770048   2. PharIo\Phive\Factory->getRunner() /usr/local/bin/phive:349
    0.0127     823488   3. PharIo\Phive\Factory->getOutput() phar:///usr/local/bin/phive/src/Factory.php:32
    0.0143     868528   4. PharIo\Phive\Cli\OutputLocator->getOutput() phar:///usr/local/bin/phive/src/Factory.php:199
    0.0143     868528   5. PharIo\Phive\UnixoidEnvironment->supportsColoredOutput() phar:///usr/local/bin/phive/src/shared/cli/output/OutputLocator.php:16
    0.0143     868904   6. PharIo\Phive\UnixoidEnvironment->getPathToCommand() phar:///usr/local/bin/phive/src/shared/environment/UnixoidEnvironment.php:51

I actually didn't know about tput command in linux and thought that it's actually a typo and it should be "output" instead, so I had to look into source files to understand what's going on.

There is also dependency on gnupg, but there is a clear output for it:

phive install
Phive 0.14.4 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
[ERROR]    No executable gpg binary found.  
[ERROR]     Either install gpg or enable the gnupg extension in PHP. 

Maybe it would be good to document it somewhere (readme?).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions