CodeIgniter Forums
Bonfire 2 Shield Config Files are incorrect - 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: Bonfire 2 Shield Config Files are incorrect (/showthread.php?tid=92506)



Bonfire 2 Shield Config Files are incorrect - positron - 02-25-2025

To test Bonfire 2 which has installation guide here: https://lonnieezell.github.io/Bonfire2/intro/installation/
I followed every step proposed by the document. First I created a CI4 AppStarter project. Then configured the .json file. Finally installed bonfire with composer. However I realized that bonfire installation modifies the Shield configuration files in Config wrongly. Therefore "php spark bf:install --continue" gives below error:
Code:
CodeIgniter v4.6.0 Command Line Tool - Server Time: 2025-02-25 08:32:54 UTC+00:00

Running all new migrations...
[Error]
Class "Config\BonfireAuth" not found
at APPPATH\Config\Auth.php:19

Backtrace:
  1    VENDORPATH\composer\ClassLoader.php:576
      include()

  2    VENDORPATH\composer\ClassLoader.php:427
      Composer\Autoload\{closure}('C:\\..\\Desktop\\Github\\bf2test\\vendor\\composer/../../app/Config\\Auth.php')

  3    [internal function]
      Composer\Autoload\ClassLoader()->loadClass('Config\\Auth')

  4    SYSTEMPATH\Config\Factories.php:290
      class_exists('Config\\Auth')

  5    SYSTEMPATH\Config\Factories.php:216
      CodeIgniter\Config\Factories::locateClass([...], 'Auth')

  6    SYSTEMPATH\Config\Factories.php:159
      CodeIgniter\Config\Factories::getDefinedInstance([...], 'Auth', [])

  7    SYSTEMPATH\Config\Factories.php:188
      CodeIgniter\Config\Factories::__callStatic('config', [])

  8    SYSTEMPATH\Common.php:210
      CodeIgniter\Config\Factories::get('config', 'Auth')

  9    VENDORPATH\codeigniter4\shield\src\Database\Migrations\2020-12-28-223112_create_auth_tables.php:32
      config('Auth')

10    SYSTEMPATH\Database\MigrationRunner.php:837
      CodeIgniter\Shield\Database\Migrations\CreateAuthTables()->__construct(Object(CodeIgniter\Database\MySQLi\Forge))

11    SYSTEMPATH\Database\MigrationRunner.php:182
      CodeIgniter\Database\MigrationRunner()->migrate('up', Object(stdClass))

12    SYSTEMPATH\Commands\Database\Migrate.php:85
      CodeIgniter\Database\MigrationRunner()->latest(null)

13    SYSTEMPATH\CLI\Commands.php:70
      CodeIgniter\Commands\Database\Migrate()->run([...])

14    SYSTEMPATH\Common.php:190
      CodeIgniter\CLI\Commands()->run('migrate', [...])

15    VENDORPATH\lonnieezell\bonfire\src\Commands\Install.php:272
      command('migrate')

16    VENDORPATH\lonnieezell\bonfire\src\Commands\Install.php:132
      Bonfire\Commands\Install()->migrate()

17    SYSTEMPATH\CLI\Commands.php:70
      Bonfire\Commands\Install()->run([...])

18    SYSTEMPATH\CLI\Console.php:48
      CodeIgniter\CLI\Commands()->run('bf:install', [...])

19    SYSTEMPATH\Boot.php:360
      CodeIgniter\CLI\Console()->run()

20    SYSTEMPATH\Boot.php:104
      CodeIgniter\Boot::runCommand(Object(CodeIgniter\CLI\Console))

21    ROOTPATH\spark:84
      CodeIgniter\Boot::bootSpark(Object(Config\Paths))

Finally I realized this issue:
Auth, AuthGroups and AuthToken Config classes are defined this way:

PHP Code:
use CodeIgniter\Shield\Config\AuthGroups as ShieldAuthGroups;
class 
AuthGroups extends BonfireAuthGroups
-----
use 
CodeIgniter\Shield\Config\Auth as ShieldAuth;
class 
Auth extends BonfireAuth
-----
use 
CodeIgniter\Shield\Config\AuthToken as ShieldAuthToken;
/**
 * Configuration for Token Auth and HMAC Auth
 */
class AuthToken extends BonfireAuthToken 

Those classes must extend "Shield" I guess. Because there is no BonfireAuth related class. I dont know why I face this issue. Maybe it is because of first initialization of bonfire with "
Code:
php spark bf:install". Any help will be appreciated. Thanks.

p.s. Should I create an issue in bonfire github repo instead of posting here? Please inform.



RE: Bonfire 2 Shield Config Files are incorrect - datamweb - 02-25-2025

Bonfire2 has an active maintainer. You can bring this up in the discussion or bug report section.


RE: Bonfire 2 Shield Config Files are incorrect - luckmoshy - 02-26-2025

You are right, @positron They updated recently but unfortunatelly messed on that area If your familiar with bonfire, you can personally correct there and waiting until they update to next version where they will detect it or create an issue in bonfire github repo


RE: Bonfire 2 Shield Config Files are incorrect - bwo82 - 03-25-2025

Hello - 

I am currently trying to grasp Bonfire2 and I am having an awful time understanding what the /themes folder actually does?  I mean, Bonfire is all about modules, and so part of that installation is to add a directory, that doesn't sit in any module, for what? Is there a working example that has this in place? Please don't send me a link to the Pages module, or the Bonfire2 page - I've looked those over ad nauseum and I just keep rereading the part about where Bonfire is all in the vendor folder so it keeps your App folder clean, but then says to copy Config files over (kinda).....


RE: Bonfire 2 Shield Config Files are incorrect - luckmoshy - 03-26-2025

(03-25-2025, 02:01 AM)bwo82 Wrote: Hello - 

what the /themes folder actually does? 


Typically, the theme folder helps you organize and take control of your app front-end development. In the theme folder, once you have successfully installed it, the Bonfire 2 theme folder will be copied from the Bonfire module to the app's main root, letting you start developing your app. so the theme folder stands for front-end development and includes React, Vue, Svelte, HTMX, alpine Tailwind, and son and donot forget that you will have privilege of using component in your dev