Wrong path in vendor/codeigniter4/framework/App/Config/Paths.php |
Hi. There is a wrong path to system directory in vendor/codeigniter4/framework/App/Config/Paths.php:
PHP Code: public string $systemDirectory = __DIR__ . '/../../system'; The correct one is in the App/Config/Paths.php: PHP Code: public string $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system'; I was updating my application from 4.3.* to 4.4.*. At first I ran "composer update" command. It updated CodeIgniter in vendor/codeigniter4/framework. From vendor directory I copied spark and public/index.php where they belongs. Then I copied all config files from vendor to App/Config and set my settings. Then my application stopped working. php spark serve command did not work. I realized, the problem is int he paths. If you will make a fresh CodeIgniter installation and then copy vendor/codeigniter4/framework/App/Config/Paths.php to App/Config/Paths.php, you will get similar result as I did. I presume, these App directories in the root and in the vendor should be the same. Command: php spark serve Code: PHP Warning: require(app/Config/../../system/bootstrap.php): Failed to open stream: No such file or directory in spark on line 75
The contents of the App directory in the vendor folder are the "original" or "default" code, which references the system folder within the vendor/codeigniter4/framework/ path. They have nothing to do with the way your application works.
The contents of the App directory in the root folder powers your application, and since it still has to use the core files, the system path still needs to point to the vendor/codeigniter4/framework/system folder.
It must be __DIR__ . '/../../system' for Zip downloads.
But yes, it is not correct for Composer installation. Do you propose to stop Zip downloads? (11-09-2023, 05:48 AM)kenjis Wrote: It must be __DIR__ . '/../../system' for Zip downloads. Oh, that is why... I thought it was a bug. No, let it be as it is. It is a good think to have possibility to start a new project without Composer (or internet). |
Welcome Guest, Not a member yet? Register Sign In |