Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth driver error
  • Hi to all, These days I'm figuring out my way around Fuel's awesomeness. I'm still getting used to the differences from CI.
    I'm trying to make a simple auth driver so I can learn in the process. However I've got stuck in step 1. When trying to use the driver the app throws an exception "ErrorException [ Error ]: Class 'Auth_Login_Slauth' not found". However the file for the login driver is called slauth.php and is located in packages/auth/classes/login.
    This is the declaration and the namespace
    namespace Auth;
    
    class Auth_Login_Slauth extends \Auth_Login_Driver
    

    Is there anything I'm missing or erring in?
  • This is one of the docs I should write ASAP but don't have the time to :( Like you shouldn't extend the core within the core, you shouldn't extend a package within itself (unless of course it's your own package of some kind, than it's all up to you). Put the file in your app at fuel/app/classes/auth/login/slauth.php and remove the namespace decleration and it should work fine. (and why it isn't found currently: classes within the Auth package need to be registered in the Auth's bootstrap to be found by the autoloader, but you should just extend in your app)
  • As you explained it it sounds pretty obvious, don't know how I didn't think of it.
    Thanks for the clarification and thanks for the great framework.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion