Welcome Guest, Not a member yet? Register   Sign In
Multiple Applications
#11

(This post was last modified: 04-13-2022, 06:15 PM by kenjis.)

@Codinglander

If you have "App\\" and "Config\\" in autoload.psr-4 of composer.json, remove them.

Code:
--- a/composer.json
+++ b/composer.json
@@ -17,10 +17,6 @@
        "ext-fileinfo": "Improves mime type detection for files"
    },
    "autoload": {
-        "psr-4": {
-            "App\\": "app",
-            "Config\\": "app/Config"
-        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]

And update Composer's autoload configuration.

Code:
$ composer dump-autoload

See Running Multiple Applications with one CodeIgniter Installation
https://github.com/kenjis/codeigniter4-m...pps-sample
Reply
#12

(This post was last modified: 04-13-2022, 11:13 PM by Codinglander.)

(04-13-2022, 04:29 PM)kenjis Wrote: Check the path is correct.

PHP Code:
echo COMPOSER_PATH; exit; 


By the way, why do you want to use Multiple Applications?
It seems there is no particular merit in that configuration.

Just installing two appstarter is easy and simple, and
it could reduce the upgrade costs.

Good Morning....
Path seems to be correct...

but I don't understand why the other manuals using composer not working (e.g. MGatner's settings ).

I need multiple applications for several projects for some sites for kindergarden, all hosted on one domain and there I need for each one subdomain.
Therefore I want to use only ONE ci-installation with many apps, one for every kindergarden...

(04-13-2022, 05:45 PM)kenjis Wrote: @Codinglander

If you have "App\\" and "Config\\" in autoload.psr-4 of composer.json, remove them.

Code:
--- a/composer.json
+++ b/composer.json
@@ -17,10 +17,6 @@
        "ext-fileinfo": "Improves mime type detection for files"
    },
    "autoload": {
-        "psr-4": {
-            "App\\": "app",
-            "Config\\": "app/Config"
-        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]

And update Composer's autoload configuration.

Code:
$ composer dump-autoload

See Running Multiple Applications with one CodeIgniter Installation
https://github.com/kenjis/codeigniter4-m...pps-sample

Aaaaaahhhhh....
With the guide on https://github.com/kenjis/codeigniter4-m...pps-sample now all works fine, thanks a lot.
Maybe the official guide will be updated for upcoming users Wink
I mark this as solved !!!

Thanks a lot, folks !!!!!!  Big Grin

Your's

Kighlander
Reply
#13

(04-13-2022, 10:32 PM)Codinglander Wrote: Maybe the official guide will be updated for upcoming users Wink

I sent a PR: https://github.com/codeigniter4/CodeIgniter4/pull/5897
Reply
#14

@Codinglander I found this error is due to a bug.

Quote:If the same namespace is defined in both CodeIgniter and Composer, CodeIgniter’s autoloader will be the first one to get a chance to locate the file.
https://codeigniter4.github.io/CodeIgnit...er-support

The namespace Config is defined in CodeIgniter. So it should be loaded even if Composer has a wrong path.

I sent a PR to fix:
https://github.com/codeigniter4/CodeIgniter4/pull/5902

Thanks for reporting!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB