CI4 入门问题

CI4 Getting started issues

决定试试新发布的 CI4。

Ubuntu 操作系统 php 7.4.3.

遵循 https://codeigniter4.github.io/userguide/installation/index.html

中的文档
composer create-project codeigniter4/appstarter c400
cd c400
# Not sure if this is needed
php builds development
composer update # per the build's output
php spark serve

这导致:

CodeIgniter CLI Tool - Version 4.0.1 - Server-Time: 2020-02-24 10:41:36am

PHP Fatal error:  Cannot declare class CodeIgniter\Commands\CommandsTestStreamFilter, because the name is already in use in /home/ahundiak/zayso2020/c400/tests/_support/Commands/CommandsTestStreamFilter.php on line 3
PHP Stack trace:
PHP   1. {main}() /home/ahundiak/zayso2020/c400/spark:0
PHP   2. CodeIgniter\CLI\Console->run() /home/ahundiak/zayso2020/c400/spark:57
PHP   3. CodeIgniter\CodeIgniter->run() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/Console.php:86
PHP   4. CodeIgniter\CodeIgniter->handleRequest() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:306
PHP   5. CodeIgniter\CodeIgniter->runController() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:398
PHP   6. CodeIgniter\CLI\CommandRunner->_remap() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:906
PHP   7. CodeIgniter\CLI\CommandRunner->index() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:86
PHP   8. CodeIgniter\CLI\CommandRunner->createCommandList() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:103
PHP   9. class_exists() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  10. spl_autoload_call() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  11. Composer\Autoload\ClassLoader->loadClass() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  12. Composer\Autoload\includeFile() /home/ahundiak/zayso2020/c400/vendor/composer/ClassLoader.php:322
PHP  13. include() /home/ahundiak/zayso2020/c400/vendor/composer/ClassLoader.php:444
An uncaught Exception was encountered

Type:        ErrorException
Message:     Cannot declare class CodeIgniter\Commands\CommandsTestStreamFilter, because the name is already in use
Filename:    /home/ahundiak/zayso2020/c400/tests/_support/Commands/CommandsTestStreamFilter.php
Line Number: 3

该错误与 Symfony 在首次引入预加载时生成的一些错误没有什么不同。但是 7.4.3 至少为 Symfony 解决了这些问题。

我开始逐步研究 spark 控制台代码,但我想看看是否还有其他人 运行 参与其中。

更新:来自https://forum.codeigniter.com/thread-75587.html,看来这个问题正在解决中。修复发布后我会回来关闭它。

等了几天才发布修复程序。是否进行了作曲家更新,将我从 CLI 4.0.1 转移到 4.0.2,但问题仍然存在。

创建了一个新项目,一切都按预期进行。

不确定作曲家更新是否应该工作,但至少现在显示了欢迎页面。