CodeIgniter Forums
Error after rename app direcory - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Error after rename app direcory (/showthread.php?tid=81153)



Error after rename app direcory - piieerre - 01-28-2022

Hello everyone.

After days of searching for a problem, I need your help!

I'm trying to rename the "app" directory to "myapp" but I get this error:

Code:
Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\CodeIgniter::__construct() must be an instance of Config\App, null given, called in C:\wamp64\www\CI4\vendor\codeigniter4\framework\system\Config\Services.php on line 139 and defined in C:\wamp64\www\CI4\vendor\codeigniter4\framework\system\CodeIgniter.php on line 147
I followed the Codeigniter documentation for the following changes.

In Config/Paths.php

PHP Code:
public $appDirectory __DIR__ '/..'
In public/index.php

PHP Code:
$pathsConfig FCPATH '../myapp/Config/Paths.php'


I did a CI 4 install with composer with this command line :

Code:
composer create-project codeigniter4/appstarter --no-dev
Here is my file structure

[Image: capture.png]

And I use Wampserver
Thanks in advance everyone!
Pierre


RE: Error after rename app direcory - kenjis - 01-28-2022

Why do you need to change? It is not so easy.

Code:
--- a/composer.json
+++ b/composer.json
@@ -18,8 +18,6 @@
    },
    "autoload": {
        "psr-4": {
-            "App\\": "app",
-            "Config\\": "app/Config"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"

And run `composer dump-autoload`.


RE: Error after rename app direcory - InsiteFX - 01-29-2022

It will also mess up spark.