CodeIgniter Forums
Config\Paths different on appStarter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Config\Paths different on appStarter (/showthread.php?tid=82668)



Config\Paths different on appStarter - jetspeed - 08-06-2022

Hi guys,

Whilst going through the upgrade from 4.2.1 to 4.2.2, I noted that the upgrade guide mentioned app/Config/Paths.php was changed.

Without much thought I copied that file over from vendor/codeigniter4/framework/app.

When I ran my app, it broke. I rechecked the file and noticed in appStarter github, line 28 was

Code:
public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system';


compared to the vendor framework version which was:


PHP Code:
public $systemDirectory __DIR__ '/../../system'

Is this the only file that is different in the vendor directory for appstarter? Or is there potentially others that differ and can catch me out in future?


RE: Config\Paths different on appStarter - kenjis - 08-06-2022

See https://github.com/codeigniter4/appstarter/commit/59383a85a988f2abaf312a985160646698124a60#diff-08ac7d912d9767f1602489e6278c24072ce81a5f49e403408c8e56c9f8fe376b
It is the change in app/Config/Paths.php

This might be tricky, but codeigniter4/framework/app/* is not the same as appstarter/app/*.


RE: Config\Paths different on appStarter - kenjis - 08-06-2022

Only the Paths.php is different.

Code:
$ diff -urN framework-4.2.3/app appstarter-4.2.3/app
diff -urN framework-4.2.3/app/Config/Paths.php appstarter-4.2.3/app/Config/Paths.php
--- framework-4.2.3/app/Config/Paths.php 2022-08-07 09:10:38.000000000 +0900
+++ appstarter-4.2.3/app/Config/Paths.php 2022-08-05 23:57:24.000000000 +0900
@@ -25,7 +25,7 @@
      *
      * @var string
      */
-    public $systemDirectory = __DIR__ . '/../../system';
+    public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system';

    /**
      * ---------------------------------------------------------------



RE: Config\Paths different on appStarter - jetspeed - 08-06-2022

(08-06-2022, 05:55 AM)kenjis Wrote: This might be tricky, but codeigniter4/framework/app/* is not the same as appstarter/app/*.

I'd like to know how to handle the upgrade of the config files when using appStarter.

If I do a composer update, only files in vendor/codeigniter4/framework/app/Config are updated. appstarter/app/Config remains unchanged.

So I then merge changed files from codeigniter4/framework/app/Config to appstarter/app/Config. Please advise what I should be doing if this is the wrong way.

If it is correct, then my problem as described in the O.P. is that Paths.php from the vendor folder is not compatible with the appstarter one  - systemDirectory should not be merged. This is not documented anywhere, so I just wanted clarification if this is the only one that needed careful attention.

I hope my question makes sense.


RE: Config\Paths different on appStarter - kenjis - 08-07-2022

I've checked. Yes, only $systemDirectory should not be merged.


RE: Config\Paths different on appStarter - kenjis - 08-07-2022

To begin with, app/Config/* has configuration files for your app.
So you have responsible to the values.
I mean, you should know what you change. Because these are your app config.

If you blindly copies files from  vendor/codeigniter4/framework/app/Config/*,
for example, if the one CI4's default configuration changes,
Your application may stop working because of the changes.
It is a rare occurrence, though.


RE: Config\Paths different on appStarter - jetspeed - 08-07-2022

Thanks for confirming.

I do the merge taking note of what's in the upgrade guide.

In this case, I saw the system directory has changed, but thought nothing of it, assuming it was some cleanup.

It's a mistake on my end, and I will need to document being careful with Paths.php in the appstarter.