Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: spark issue #4144

Closed
ageir opened this issue Jan 21, 2021 · 8 comments
Closed

Bug: spark issue #4144

ageir opened this issue Jan 21, 2021 · 8 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@ageir
Copy link

ageir commented Jan 21, 2021

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/[email protected]/

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/[email protected]/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php:157
Stack trace:
#0 /home/[email protected]/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php(83): CodeIgniter\Config\Config::createClass()
#1 /home/[email protected]/project/appstarter/vendor/codeigniter4/framework/system/Common.php(155): CodeIgniter\Config\Config::get()
#2 /home/[email protected]/project/appstarter/vendor/codeigniter4/framework/system/bootstrap.php(179): config()
#3 /home/[email protected]/project/appstarter/spark(44): require('/home/user@aad...')
#4 {main}
  thrown in /home/[email protected]/project/appstarter/vendor/codeigniter4/framework/system/Config/Config.php on line 157

Context

  • OS: Ubuntu 20.04
  • Web server: cli
  • PHP version 7.4.3
@ageir ageir added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 21, 2021
@michalsn michalsn changed the title Bug: Bug: spark issue Jan 21, 2021
@paulbalandan
Copy link
Member

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
Copy link
Author

ageir commented Feb 6, 2021

@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/[email protected]/myproject/vendor/codeigniter4/framework/system/bootstrap.php:158
Stack trace:
#0 /home/[email protected]/myproject/spark(44): require()
#1 {main}
  thrown in /home/[email protected]/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
Copy link
Member

How did you update your appstarter copy?

@paulbalandan
Copy link
Member

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
Copy link
Author

ageir commented Feb 6, 2021

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

@paulbalandan
Copy link
Member

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
Copy link
Author

ageir commented Feb 6, 2021

Cool, thanks! I'll try it.

@sanjeevdivekar
Copy link

I am facing same problem with Fresh CodeIgniter 4.2.1 installation

I am new to CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants