codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.33k stars 1.9k forks source link

Bug: spark issue #4144

Closed ageir closed 3 years ago

ageir commented 3 years ago

Describe the bug Spark not working with home directories and usernames that has @ in it. For example AAD, connected to a Active Directory server. /home/user@aad.domain.com/

CodeIgniter 4 version 4.0.4

Affected module(s) spark

Expected behavior, and steps to reproduce if appropriate composer create-project codeigniter4/appstarter project then go into the appstarter directory and run: php spark

Error:

PHP Fatal error:  Uncaught Error: Class 'Config\App' not found in /home/user@aad.domain.com/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php:157
Stack trace:
#0 /home/user@aad.domain.com/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass()
#1 /home/user@aad.domain.com/project/appstarter/vendor/codeigniter4/framework/system/Common.php(155): CodeIgniter\Config\Config::get()
#2 /home/user@aad.domain.com/project/appstarter/vendor/codeigniter4/framework/system/bootstrap.php(179): config()
#3 /home/user@aad.domain.com/project/appstarter/spark(44): require('/home/user@aad...')
#4 {main}
  thrown in /home/user@aad.domain.com/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php on line 157

Context

paulbalandan commented 3 years ago

I can confirm this is also an issue with Windows, but on codeigniter4/appstarter v4.0.4 only. After updating all the appstarter stuff with the latest from dev-develop, this works as expected even with @ in directory name.

PS C:\Users\P\Desktop\Web Dev\ci4@app> php spark

CodeIgniter v4.0.4 Command Line Tool - Server Time: 2021-01-22 11:53:46 UTC-06:00

Cache
  cache:clear         Clears the current system caches.
  cache:info          Shows file cache information in the current system.

CodeIgniter
  help                Displays basic usage information.
  list                Lists the available commands.
  namespaces          Verifies your namespaces are setup correctly.
  routes              Displays all of user-defined routes. Does NOT display auto-detected routes.
  serve               Launches the CodeIgniter PHP-Development Server.

Database
  db:create           Create a new database schema.
  db:seed             Runs the specified seeder to populate known data into the database.
  migrate             Locates and runs all new migrations against the database.
  migrate:refresh     Does a rollback followed by a latest to refresh the current state of the database.
  migrate:rollback    Runs the "down" method for all migrations in the last batch.
  migrate:status      Displays a list of all migrations and whether they've been run or not.

Encryption
  key:generate        Generates a new encryption key and writes it in an `.env` file.

Generators
  make:command        Creates a new spark command.
  make:controller     Creates a new controller file.
  make:entity         Creates a new entity file.
  make:filter         Creates a new filter file.
  make:migration      Creates a new migration file.
  make:model          Creates a new model file.
  make:scaffold       Creates a complete set of scaffold files.
  make:seeder         Creates a new seeder file.
  migrate:create      [DEPRECATED] Creates a new migration file. Please use "make:migration" instead.
  session:migration   Generates the migration file for database sessions.

Housekeeping
  debugbar:clear      Clears all debugbar JSON files.
  logs:clear          Clears all log files.

You can anticipate in the next release this issue is solved.

ageir commented 3 years ago

@paulbalandan

This is still an issue for me. Upgraded to 4.1.1

PHP Fatal error:  Uncaught Error: Class 'Config\App' not found in /home/user@aad.domain.com/myproject/vendor/codeigniter4/framework/system/bootstrap.php:158
Stack trace:
#0 /home/user@aad.domain.com/myproject/spark(44): require()
#1 {main}
  thrown in /home/user@aad.domain.com/myproject/vendor/codeigniter4/framework/system/bootstrap.php on line 158

This works perfectly on my server. And on my computer if I move the myproject directory to /user/myproject/

Please reopen this issue.

paulbalandan commented 3 years ago

How did you update your appstarter copy?

paulbalandan commented 3 years ago

If you simply used composer update this will only update your vendor. You need to also update your project's own copy of app, public, spark, and env

ageir commented 3 years ago

I just ran composer update. So all files in app, public, spark and env needs to updated? from where?

paulbalandan commented 3 years ago

The idea is you will compare the files in vendor/codeigniter4/framework/app/ against your own app/ files. Copy those changed or added files. After that, do the same for public, writable, env and spark.

Sidenote: To save you from all the hassle, you can use this library of mine to do all of this automatically. You just need to be extra careful of your decisions regarding overwriting or skipping files. For this it has the option to view the diff for each file.

ageir commented 3 years ago

Cool, thanks! I'll try it.

sanjeevdivekar commented 2 years ago

I am facing same problem with Fresh CodeIgniter 4.2.1 installation

I am new to CI.