Welcome Guest, Not a member yet? Register   Sign In
Wrong path in vendor/codeigniter4/framework/App/Config/Paths.php
#1
Bug 
(This post was last modified: 11-09-2023, 02:00 AM by Muzikant.)

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

Warning: require(app/Config/../../system/bootstrap.php): Failed to open stream: No such file or directory in spark on line 75
PHP Fatal error:  Uncaught Error: Failed opening required 'app/Config/../../system/bootstrap.php' (include_path='.:php') in spark:75
Stack trace:
#0 {main}
  thrown in spark on line 75

Fatal error: Uncaught Error: Failed opening required 'app/Config/../../system/bootstrap.php' (include_path='.:php') in spark:75
Stack trace:
#0 {main}
  thrown in spark on line 75
Reply
#2

(This post was last modified: 11-09-2023, 02:01 AM by sammyskills.)

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.
Reply
#3

It must be __DIR__ . '/../../system' for Zip downloads.
But yes, it is not correct for Composer installation.

Do you propose to stop Zip downloads?
Reply
#4

(This post was last modified: 11-09-2023, 10:18 AM by Muzikant.)

(11-09-2023, 05:48 AM)kenjis Wrote: It must be __DIR__ . '/../../system' for Zip downloads.
But yes, it is not correct for Composer installation.

Do you propose to stop 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).
Reply




Theme © iAndrew 2016 - Forum software by © MyBB