Closed glensc closed 7 years ago
error when /tmp/bartlett/compatinfo.sqlite
is not accessible:
[~] ➔ phpcompatinfo.phar
PHP Warning: copy(/tmp/bartlett/compatinfo.sqlite): failed to open stream: Permission denied in phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-compatinfo-db/src/Bartlett/CompatInfoDb/Environment.php on line 53
PHP Stack trace:
PHP 1. {main}() /home/glen/.local/bin/phpcompatinfo.phar:0
PHP 2. require() /home/glen/.local/bin/phpcompatinfo.phar:45
PHP 3. Bartlett\Reflect\Console\Application->run() phar:///home/glen/.local/bin/phpcompatinfo.phar/bin/phpcompatinfo:51
PHP 4. Symfony\Component\Console\Application->run() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/Application.php:242
PHP 5. Bartlett\Reflect\Console\Application->doRun() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Application.php:123
PHP 6. Symfony\Component\Console\Application->doRun() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/Application.php:267
PHP 7. Symfony\Component\Console\Application->doRunCommand() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Application.php:192
PHP 8. Symfony\Component\Console\Command\Command->run() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Application.php:860
PHP 9. Symfony\Component\Console\Command\ListCommand->execute() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Command/Command.php:259
PHP 10. Symfony\Component\Console\Helper\DescriptorHelper->describe() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Command/ListCommand.php:81
PHP 11. Symfony\Component\Console\Descriptor\Descriptor->describe() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Helper/DescriptorHelper.php:72
PHP 12. Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Descriptor/Descriptor.php:55
PHP 13. Bartlett\Reflect\Console\Application->getHelp() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Descriptor/TextDescriptor.php:180
PHP 14. Symfony\Component\Console\Application->getHelp() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-reflect/src/Bartlett/Reflect/Console/Application.php:175
PHP 15. Bartlett\CompatInfo\Console\Application->getLongVersion() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/symfony/console/Application.php:245
PHP 16. Bartlett\CompatInfoDb\Environment::versionRefDb() phar:///home/glen/.local/bin/phpcompatinfo.phar/src/Bartlett/CompatInfo/Console/Application.php:52
PHP 17. Bartlett\CompatInfoDb\Environment::initRefDb() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-compatinfo-db/src/Bartlett/CompatInfoDb/Environment.php:67
PHP 18. copy() phar:///home/glen/.local/bin/phpcompatinfo.phar/vendor/bartlett/php-compatinfo-db/src/Bartlett/CompatInfoDb/Environment.php:53
[PDOException]
SQLSTATE[HY000] [14] unable to open database file
list [--xml] [--raw] [--format FORMAT] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--no-plugins] [--profile] [--progress] [--output OUTPUT] [--manifest] [--] <command> [<namespace>]
[~] ➔
suggestion:
do not use world writable dirs with fixed names for storing state data (temporary files created with tempnam are ok), use user's $HOME
for such data, perhaps some packagist library implementing xdg spec: https://packagist.org/search/?q=xdg
Hello @glensc
I've not forgotten your report; thanks ! I've finally have time to have a look on it and implement a solution yesterday.
I should be able to publish it this week. As this issue is related to another package that handle the database, I'll close this one, and link them
To follow on package php-compatinfo-db issue
the tool uses sqlite database from known path
/tmp/bartlett/compatinfo.sqlite
.this has several issues:
as for the third point, it's rather easily achieved: