Welcome Guest, Not a member yet? Register   Sign In
Starting with Myth:Auth - some questions
#7

(11-01-2019, 09:04 AM)kilishan Wrote: You're right, I should add manual installation instructions back in. Had it there at one point, but then got it up on Packagist so Composer install would work and I replaced it instead of augmented the instructions. I'll get that remedied soon-ish.

The beauty of auto-loading is that you can place those files anywhere on the system you want (maybe app/ThirdParty?). Then you just have to tell the autoloader where to find it by editing app/Config/Autoload.php and add the Myth\Auth namespace to the $psr4 array.

PHP Code:
$psr4 = [
    'Config' => APPPATH 'Config',
    APP_NAMESPACE => APPPATH,            
    
'App' => APPPATH,
    'Myth/Auth' => APPPATH .'ThirdParty/Myth/Auth/src',
]; 

Since CI4 have the option to be installed without composer, a good library should also have that option...  Big Grin

I will keep the app folder only with my own code. I will place the Myth/Auth inside root/third-party (just my personal taste)

Another question, is auto-loading really required ? I mean, is it going to be loaded in every controller ? What about the controllers that doesn´t require it ? Is there a way to load it just when it is needed ?

Thanks again !
Reply


Messages In This Thread
RE: Starting with Myth:Auth - some questions - by Poetawd - 11-01-2019, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB